Class: ScheduledValue::TimespanWithValue

Inherits:
Timespan
  • Object
show all
Defined in:
lib/scheduled_value/timespan_with_value.rb

Instance Attribute Summary collapse

Attributes inherited from Timespan

#finish, #start

Instance Method Summary collapse

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

#valueObject

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

#attributesObject



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