Sha256: 7d726f6529828733d0dbf6a890fc4fc1070eb1108951b8da067a94e76ce490d8

Contents?: true

Size: 364 Bytes

Versions: 2

Compression:

Stored size: 364 Bytes

Contents

module ScheduledValue
  class TimespanWithValue < Timespan
    attr_accessor :value

    def initialize(start: nil, finish: nil, value: nil)
      super(start: start, finish: finish)
      self.value = value
    end

    def attributes
      super.merge(value: value)
    end

    def to_s(format = nil, timezone = nil)
      "#{value} #{super}"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
scheduled_value-1.2.2 lib/scheduled_value/timespan_with_value.rb
scheduled_value-1.2.1 lib/scheduled_value/timespan_with_value.rb