Class: Zomato2::Location
- Inherits:
-
EntityBase
- Object
- EntityBase
- Zomato2::Location
- Defined in:
- lib/zomato2/location.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
basic attrs.
-
#city_id ⇒ Object
readonly
basic attrs.
-
#city_name ⇒ Object
readonly
basic attrs.
-
#country_id ⇒ Object
readonly
basic attrs.
-
#country_name ⇒ Object
readonly
basic attrs.
-
#entity_id ⇒ Object
readonly
basic attrs.
-
#entity_type ⇒ Object
readonly
basic attrs.
-
#latitude ⇒ Object
readonly
basic attrs.
-
#locality ⇒ Object
readonly
basic attrs.
-
#longitude ⇒ Object
readonly
basic attrs.
-
#title ⇒ Object
readonly
basic attrs.
-
#zipcode ⇒ Object
readonly
basic attrs.
Instance Method Summary collapse
-
#initialize(zom_conn, attributes) ⇒ Location
constructor
Zomato uses different names for the same field depending on the request..
- #to_s ⇒ Object
Methods inherited from EntityBase
Constructor Details
#initialize(zom_conn, attributes) ⇒ Location
Zomato uses different names for the same field depending on the request..
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/zomato2/location.rb', line 8 def initialize(zom_conn, attributes) super(zom_conn) @address = attributes['address'] @locality = attributes['locality'] @city_name = attributes['city'] || attributes['city_name'] @city_id = attributes['city_id'] @latitude = attributes['latitude'] || attributes['lat'] @longitude = attributes['longitude'] || attributes['lon'] @zipcode = attributes['zipcode'] @country_id = attributes['country_id'] @country_name = attributes['country_name'] @title = attributes['title'] @entity_type = attributes['entity_type'] @entity_id = attributes['entity_id'] end |
Instance Attribute Details
#address ⇒ Object (readonly)
basic attrs
4 5 6 |
# File 'lib/zomato2/location.rb', line 4 def address @address end |
#city_id ⇒ Object (readonly)
basic attrs
4 5 6 |
# File 'lib/zomato2/location.rb', line 4 def city_id @city_id end |
#city_name ⇒ Object (readonly)
basic attrs
4 5 6 |
# File 'lib/zomato2/location.rb', line 4 def city_name @city_name end |
#country_id ⇒ Object (readonly)
basic attrs
4 5 6 |
# File 'lib/zomato2/location.rb', line 4 def country_id @country_id end |
#country_name ⇒ Object (readonly)
basic attrs
4 5 6 |
# File 'lib/zomato2/location.rb', line 4 def country_name @country_name end |
#entity_id ⇒ Object (readonly)
basic attrs
4 5 6 |
# File 'lib/zomato2/location.rb', line 4 def entity_id @entity_id end |
#entity_type ⇒ Object (readonly)
basic attrs
4 5 6 |
# File 'lib/zomato2/location.rb', line 4 def entity_type @entity_type end |
#latitude ⇒ Object (readonly)
basic attrs
4 5 6 |
# File 'lib/zomato2/location.rb', line 4 def latitude @latitude end |
#locality ⇒ Object (readonly)
basic attrs
4 5 6 |
# File 'lib/zomato2/location.rb', line 4 def locality @locality end |
#longitude ⇒ Object (readonly)
basic attrs
4 5 6 |
# File 'lib/zomato2/location.rb', line 4 def longitude @longitude end |
#title ⇒ Object (readonly)
basic attrs
4 5 6 |
# File 'lib/zomato2/location.rb', line 4 def title @title end |
#zipcode ⇒ Object (readonly)
basic attrs
4 5 6 |
# File 'lib/zomato2/location.rb', line 4 def zipcode @zipcode end |
Instance Method Details
#to_s ⇒ Object
24 |
# File 'lib/zomato2/location.rb', line 24 def to_s; super; end |