Class: JustimmoClient::V1::GeoLocation

Inherits:
JustimmoBase show all
Defined in:
lib/justimmo_client/api/v1/models/geo_location.rb

Attributes collapse

Instance Method Summary collapse

Methods included from Utils

#autoload_dir, #translate

Methods included from Logging

default_logger, #logger, rails_logger

Instance Method Details

#countryCountry

Returns:



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_stateString

Returns:

  • (String)


12
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 12

attribute :federal_state, String

#floorInteger

Returns:

  • (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

#inspectObject



39
40
41
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 39

def inspect
  "#<#{self.class} #{self}>"
end

#latitudeFloat

Returns:

  • (Float)


15
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 15

attribute :latitude,      Float

#locationString

Returns:

  • (String)


17
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 17

attribute :location,      String

#longitudeFloat

Returns:

  • (Float)


16
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 16

attribute :longitude,     Float

#proximityString

Returns:

  • (String)


11
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 11

attribute :proximity,     String

#to_aObject



47
48
49
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 47

def to_a
  [latitude, longitude]
end

#to_hObject



43
44
45
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 43

def to_h
  { latitude: latitude, longitude: longitude }
end

#to_sObject



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_codeInteger

Returns:

  • (Integer)


14
# File 'lib/justimmo_client/api/v1/models/geo_location.rb', line 14

attribute :zip_code,      Integer