Class: Accuweather::Conditions::Local
- Inherits:
-
Object
- Object
- Accuweather::Conditions::Local
- Defined in:
- lib/accuweather/conditions/local.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#current_gmt_offset ⇒ Object
readonly
Returns the value of attribute current_gmt_offset.
-
#lat ⇒ Object
readonly
Returns the value of attribute lat.
-
#lon ⇒ Object
readonly
Returns the value of attribute lon.
-
#obs_daylight ⇒ Object
readonly
Returns the value of attribute obs_daylight.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#time_zone ⇒ Object
readonly
Returns the value of attribute time_zone.
-
#time_zone_abbreviation ⇒ Object
readonly
Returns the value of attribute time_zone_abbreviation.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(city:, state:, lat:, lon:, time:, time_zone:, obs_daylight:, current_gmt_offset:, time_zone_abbreviation:) ⇒ Local
constructor
A new instance of Local.
- #to_s ⇒ Object
Constructor Details
#initialize(city:, state:, lat:, lon:, time:, time_zone:, obs_daylight:, current_gmt_offset:, time_zone_abbreviation:) ⇒ Local
Returns a new instance of Local.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/accuweather/conditions/local.rb', line 6 def initialize(city:, state:, lat:, lon:, time:, time_zone:, obs_daylight:, current_gmt_offset:, time_zone_abbreviation:) @city = city @state = state @lat = lat @lon = lon @time = time @time_zone = time_zone @obs_daylight = obs_daylight @current_gmt_offset = current_gmt_offset @time_zone_abbreviation = time_zone_abbreviation end |
Instance Attribute Details
#city ⇒ Object (readonly)
Returns the value of attribute city.
4 5 6 |
# File 'lib/accuweather/conditions/local.rb', line 4 def city @city end |
#current_gmt_offset ⇒ Object (readonly)
Returns the value of attribute current_gmt_offset.
4 5 6 |
# File 'lib/accuweather/conditions/local.rb', line 4 def current_gmt_offset @current_gmt_offset end |
#lat ⇒ Object (readonly)
Returns the value of attribute lat.
4 5 6 |
# File 'lib/accuweather/conditions/local.rb', line 4 def lat @lat end |
#lon ⇒ Object (readonly)
Returns the value of attribute lon.
4 5 6 |
# File 'lib/accuweather/conditions/local.rb', line 4 def lon @lon end |
#obs_daylight ⇒ Object (readonly)
Returns the value of attribute obs_daylight.
4 5 6 |
# File 'lib/accuweather/conditions/local.rb', line 4 def obs_daylight @obs_daylight end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
4 5 6 |
# File 'lib/accuweather/conditions/local.rb', line 4 def state @state end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
4 5 6 |
# File 'lib/accuweather/conditions/local.rb', line 4 def time @time end |
#time_zone ⇒ Object (readonly)
Returns the value of attribute time_zone.
4 5 6 |
# File 'lib/accuweather/conditions/local.rb', line 4 def time_zone @time_zone end |
#time_zone_abbreviation ⇒ Object (readonly)
Returns the value of attribute time_zone_abbreviation.
4 5 6 |
# File 'lib/accuweather/conditions/local.rb', line 4 def time_zone_abbreviation @time_zone_abbreviation end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/accuweather/conditions/local.rb', line 18 def ==(other) city == other.city && state == other.state && lat == other.lat && lon == other.lon && time == other.time && time_zone == other.time_zone && obs_daylight == other.obs_daylight && current_gmt_offset == other.current_gmt_offset && time_zone_abbreviation == other.time_zone_abbreviation rescue NoMethodError false end |
#to_s ⇒ Object
32 33 34 |
# File 'lib/accuweather/conditions/local.rb', line 32 def to_s "city: #{city}, state: #{state}, lat: #{lat}, lon: #{lon}, time: #{time}, time_zone: #{time_zone}, obs_daylight: #{obs_daylight}, current_gmt_offset: #{current_gmt_offset}, time_zone_abbreviation: #{time_zone_abbreviation}" end |