Class: Accuweather::Conditions::Units
- Inherits:
-
Object
- Object
- Accuweather::Conditions::Units
- Defined in:
- lib/accuweather/conditions/units.rb
Instance Attribute Summary collapse
-
#dist ⇒ Object
readonly
Returns the value of attribute dist.
-
#prec ⇒ Object
readonly
Returns the value of attribute prec.
-
#pres ⇒ Object
readonly
Returns the value of attribute pres.
-
#speed ⇒ Object
readonly
Returns the value of attribute speed.
-
#temp ⇒ Object
readonly
Returns the value of attribute temp.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(temp:, dist:, speed:, pres:, prec:) ⇒ Units
constructor
A new instance of Units.
- #to_s ⇒ Object
Constructor Details
#initialize(temp:, dist:, speed:, pres:, prec:) ⇒ Units
Returns a new instance of Units.
6 7 8 9 10 11 12 |
# File 'lib/accuweather/conditions/units.rb', line 6 def initialize(temp:, dist:, speed:, pres:, prec:) @temp = temp @dist = dist @speed = speed @pres = pres @prec = prec end |
Instance Attribute Details
#dist ⇒ Object (readonly)
Returns the value of attribute dist.
4 5 6 |
# File 'lib/accuweather/conditions/units.rb', line 4 def dist @dist end |
#prec ⇒ Object (readonly)
Returns the value of attribute prec.
4 5 6 |
# File 'lib/accuweather/conditions/units.rb', line 4 def prec @prec end |
#pres ⇒ Object (readonly)
Returns the value of attribute pres.
4 5 6 |
# File 'lib/accuweather/conditions/units.rb', line 4 def pres @pres 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 |
#temp ⇒ Object (readonly)
Returns the value of attribute temp.
4 5 6 |
# File 'lib/accuweather/conditions/units.rb', line 4 def temp @temp 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) temp == other.temp && dist == other.dist && speed == other.speed && pres == other.pres && prec == other.prec rescue NoMethodError false end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/accuweather/conditions/units.rb', line 24 def to_s "temp: #{temp}, dist: #{dist}, speed: #{speed}, pres: #{pres}, prec: #{prec}" end |