Class: Zomato2::Location

Inherits:
EntityBase show all
Defined in:
lib/zomato2/location.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from EntityBase

#get

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

#addressObject (readonly)

basic attrs



4
5
6
# File 'lib/zomato2/location.rb', line 4

def address
  @address
end

#city_idObject (readonly)

basic attrs



4
5
6
# File 'lib/zomato2/location.rb', line 4

def city_id
  @city_id
end

#city_nameObject (readonly)

basic attrs



4
5
6
# File 'lib/zomato2/location.rb', line 4

def city_name
  @city_name
end

#country_idObject (readonly)

basic attrs



4
5
6
# File 'lib/zomato2/location.rb', line 4

def country_id
  @country_id
end

#country_nameObject (readonly)

basic attrs



4
5
6
# File 'lib/zomato2/location.rb', line 4

def country_name
  @country_name
end

#entity_idObject (readonly)

basic attrs



4
5
6
# File 'lib/zomato2/location.rb', line 4

def entity_id
  @entity_id
end

#entity_typeObject (readonly)

basic attrs



4
5
6
# File 'lib/zomato2/location.rb', line 4

def entity_type
  @entity_type
end

#latitudeObject (readonly)

basic attrs



4
5
6
# File 'lib/zomato2/location.rb', line 4

def latitude
  @latitude
end

#localityObject (readonly)

basic attrs



4
5
6
# File 'lib/zomato2/location.rb', line 4

def locality
  @locality
end

#longitudeObject (readonly)

basic attrs



4
5
6
# File 'lib/zomato2/location.rb', line 4

def longitude
  @longitude
end

#titleObject (readonly)

basic attrs



4
5
6
# File 'lib/zomato2/location.rb', line 4

def title
  @title
end

#zipcodeObject (readonly)

basic attrs



4
5
6
# File 'lib/zomato2/location.rb', line 4

def zipcode
  @zipcode
end

Instance Method Details

#to_sObject



24
# File 'lib/zomato2/location.rb', line 24

def to_s; super; end