Class: Timeseries::DataPoint
- Inherits:
-
Object
- Object
- Timeseries::DataPoint
- Defined in:
- lib/timeseries/data_point.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(date = DateTime.new, value = 0) ⇒ DataPoint
constructor
A new instance of DataPoint.
Constructor Details
#initialize(date = DateTime.new, value = 0) ⇒ DataPoint
Returns a new instance of DataPoint.
5 6 7 8 9 |
# File 'lib/timeseries/data_point.rb', line 5 def initialize date = DateTime.new , value = 0 raise ArgumentError , "Must use ruby DateTime format for DataPoint dates" unless date.class == DateTime @date = date @value = value end |
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
3 4 5 |
# File 'lib/timeseries/data_point.rb', line 3 def date @date end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/timeseries/data_point.rb', line 3 def value @value end |