Class: Accuweather::Conditions::Units
- Inherits:
-
Object
- Object
- Accuweather::Conditions::Units
- Defined in:
- lib/accuweather/conditions/units.rb
Instance Attribute Summary collapse
-
#distance ⇒ Object
readonly
Returns the value of attribute distance.
-
#precipitation ⇒ Object
readonly
Returns the value of attribute precipitation.
-
#pressure ⇒ Object
readonly
Returns the value of attribute pressure.
-
#speed ⇒ Object
readonly
Returns the value of attribute speed.
-
#temperature ⇒ Object
readonly
Returns the value of attribute temperature.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(temperature:, distance:, speed:, pressure:, precipitation:) ⇒ Units
constructor
A new instance of Units.
- #to_s ⇒ Object
Constructor Details
#initialize(temperature:, distance:, speed:, pressure:, precipitation:) ⇒ Units
Returns a new instance of Units.
6 7 8 9 10 11 12 |
# File 'lib/accuweather/conditions/units.rb', line 6 def initialize(temperature:, distance:, speed:, pressure:, precipitation:) @temperature = temperature @distance = distance @speed = speed @pressure = pressure @precipitation = precipitation end |
Instance Attribute Details
#distance ⇒ Object (readonly)
Returns the value of attribute distance.
4 5 6 |
# File 'lib/accuweather/conditions/units.rb', line 4 def distance @distance end |
#precipitation ⇒ Object (readonly)
Returns the value of attribute precipitation.
4 5 6 |
# File 'lib/accuweather/conditions/units.rb', line 4 def precipitation @precipitation end |
#pressure ⇒ Object (readonly)
Returns the value of attribute pressure.
4 5 6 |
# File 'lib/accuweather/conditions/units.rb', line 4 def pressure @pressure end |
#speed ⇒ Object (readonly)
Returns the value of attribute speed.
4 5 6 |
# File 'lib/accuweather/conditions/units.rb', line 4 def speed @speed end |
#temperature ⇒ Object (readonly)
Returns the value of attribute temperature.
4 5 6 |
# File 'lib/accuweather/conditions/units.rb', line 4 def temperature @temperature end |
Instance Method Details
#==(other) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/accuweather/conditions/units.rb', line 14 def ==(other) temperature == other.temperature && distance == other.distance && speed == other.speed && pressure == other.pressure && precipitation == other.precipitation rescue NoMethodError false end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/accuweather/conditions/units.rb', line 24 def to_s "temperature: #{temperature}, distance: #{distance}, speed: #{speed}, pressure: #{pressure}, precipitation: #{precipitation}" end |