Class: JustimmoClient::V1::GeoLocation
Instance Method Summary
collapse
Methods included from Utils
#autoload_dir, #translate
Methods included from Logging
default_logger, #logger, rails_logger
Instance Method Details
13
|
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 13
attribute :country, Country
|
#country=(code) ⇒ Object
23
24
25
|
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 23
def country=(code)
@country = Country.new(alpha3: code)
end
|
#federal_state ⇒ String
12
|
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 12
attribute :federal_state, String
|
#floor ⇒ Integer
19
|
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 19
attribute :floor, Integer
|
#floor=(flr) ⇒ Object
31
32
33
|
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 31
def floor=(flr)
@floor = flr.to_i
end
|
#inspect ⇒ Object
39
40
41
|
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 39
def inspect
"#<#{self.class} #{self}>"
end
|
#latitude ⇒ Float
15
|
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 15
attribute :latitude, Float
|
#location ⇒ String
17
|
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 17
attribute :location, String
|
#longitude ⇒ Float
16
|
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 16
attribute :longitude, Float
|
#proximity ⇒ String
11
|
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 11
attribute :proximity, String
|
#to_a ⇒ Object
47
48
49
|
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 47
def to_a
[latitude, longitude]
end
|
#to_h ⇒ Object
43
44
45
|
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 43
def to_h
{ latitude: latitude, longitude: longitude }
end
|
#to_s ⇒ Object
35
36
37
|
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 35
def to_s
["#{zip_code} #{location}", federal_state, country].compact.join(", ")
end
|
#zip_code ⇒ Integer
14
|
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 14
attribute :zip_code, Integer
|