Sha256: 91e78c3f5aba5dcc19469049003ca552133ede4ccadd9de8f122fa8f5bf0afbb

Contents?: true

Size: 592 Bytes

Versions: 1

Compression:

Stored size: 592 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

1 entries across 1 versions & 1 rubygems

Version Path
barometer-0.8.0 lib/barometer/data/location.rb