class Accuweather::Location::City

Attributes

city[R]
id[R]
latitude[R]
longitude[R]
state[R]

Public Class Methods

new(id:, city:, state:, latitude:, longitude:) click to toggle source
# File lib/accuweather/location/city.rb, line 6
def initialize(id:, city:, state:, latitude:, longitude:)
  @id = id
  @city = city
  @state = state
  @latitude = latitude
  @longitude = longitude
end

Public Instance Methods

==(other) click to toggle source
# File lib/accuweather/location/city.rb, line 14
def ==(other)
  id == other.id &&
    city == other.city &&
    state == other.state &&
    latitude == other.latitude &&
    longitude == other.longitude
rescue NoMethodError
  false
end
to_s() click to toggle source
# File lib/accuweather/location/city.rb, line 24
def to_s
  "id: #{id}, city: #{city}, state: #{state}, latitude: #{latitude}, longitude: #{longitude}"
end