Class: ScheduledValue::TimespanWithValue
- Defined in:
- lib/scheduled_value/timespan_with_value.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Timespan
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(start: nil, finish: nil, value: nil) ⇒ TimespanWithValue
constructor
A new instance of TimespanWithValue.
- #to_s(format = nil) ⇒ Object
Methods inherited from Timespan
#<=>, #contains?, #finish_description, #inspect, #overlaps?, #start_description
Constructor Details
#initialize(start: nil, finish: nil, value: nil) ⇒ TimespanWithValue
Returns a new instance of TimespanWithValue.
5 6 7 8 |
# File 'lib/scheduled_value/timespan_with_value.rb', line 5 def initialize(start: nil, finish: nil, value: nil) super(start: start, finish: finish) self.value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/scheduled_value/timespan_with_value.rb', line 3 def value @value end |
Instance Method Details
#attributes ⇒ Object
10 11 12 |
# File 'lib/scheduled_value/timespan_with_value.rb', line 10 def attributes super.merge(value: value) end |
#to_s(format = nil) ⇒ Object
14 15 16 |
# File 'lib/scheduled_value/timespan_with_value.rb', line 14 def to_s(format = nil) "#{value} #{super}" end |