Class: Barometer::Data::Geo

Inherits:
Coordinates show all
Defined in:
lib/barometer/data/geo.rb

Instance Method Summary collapse

Methods inherited from Coordinates

#coordinates

Instance Method Details

#merge(other_geo) ⇒ Object



17
18
19
20
# File 'lib/barometer/data/geo.rb', line 17

def merge(other_geo)
  return unless other_geo.is_a?(Data::Geo)
  Data::Geo.new(merged_attributes(other_geo))
end

#to_sObject



12
13
14
15
# File 'lib/barometer/data/geo.rb', line 12

def to_s
  [address, locality, region, country || country_code].
    compact.reject(&:empty?).join(', ')
end