Sha256: 0ba7a432165c58bc31b7fd39e4ebfed8598df9efdd1f1f6ddb8118e42567c18c

Contents?: true

Size: 608 Bytes

Versions: 14

Compression:

Stored size: 608 Bytes

Contents

module Barometer
  #
  # A simple Location class
  # 
  # Used to store location information about the station that
  # gave the measurement data for a weather query, or the location
  # that was queried
  #
  class Data::Location
    
    attr_accessor :id, :name, :city
    attr_accessor :state_name, :state_code, :country, :country_code, :zip_code
    attr_accessor :latitude, :longitude
    
    def coordinates
      [@latitude, @longitude].join(',')
    end
    
    def to_s
      [@name, @city, @state_name || @state_cocde,
        @country || @country_code].compact.join(', ')
    end
    
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
attack-barometer-0.5.0 lib/barometer/data/location.rb
attack-barometer-0.6.0 lib/barometer/data/location.rb
attack-barometer-0.6.1 lib/barometer/data/location.rb
barometer-0.7.3 lib/barometer/data/location.rb
barometer-0.7.2 lib/barometer/data/location.rb
barometer-0.7.1 lib/barometer/data/location.rb
barometer-0.7.0 lib/barometer/data/location.rb
barometer-0.6.7 lib/barometer/data/location.rb
barometer-0.6.6 lib/barometer/data/location.rb
barometer-0.6.4 lib/barometer/data/location.rb
barometer-0.6.3 lib/barometer/data/location.rb
barometer-0.6.2 lib/barometer/data/location.rb
barometer-0.6.1 lib/barometer/data/location.rb
barometer-0.5.0 lib/barometer/data/location.rb