Class: Wasserstand::Measurement
- Inherits:
-
Object
- Object
- Wasserstand::Measurement
- Defined in:
- lib/wasserstand/measurement.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#trend ⇒ Object
readonly
Returns the value of attribute trend.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(date, value, trend) ⇒ Measurement
constructor
A new instance of Measurement.
- #to_i ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(date, value, trend) ⇒ Measurement
Returns a new instance of Measurement.
5 6 7 |
# File 'lib/wasserstand/measurement.rb', line 5 def initialize(date, value, trend) @date, @value, @trend = date, value, trend end |
Instance Attribute Details
#date ⇒ Object (readonly)
Returns the value of attribute date.
3 4 5 |
# File 'lib/wasserstand/measurement.rb', line 3 def date @date end |
#trend ⇒ Object (readonly)
Returns the value of attribute trend.
3 4 5 |
# File 'lib/wasserstand/measurement.rb', line 3 def trend @trend end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
3 4 5 |
# File 'lib/wasserstand/measurement.rb', line 3 def value @value end |
Instance Method Details
#to_i ⇒ Object
9 10 11 |
# File 'lib/wasserstand/measurement.rb', line 9 def to_i @value end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/wasserstand/measurement.rb', line 13 def to_s "#{@date}: #{@value} cm, trend #{@trend}" end |