Class: Bonito::OffsetTimeline

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/bonito/timeline.rb

Overview

:nodoc:

Direct Known Subclasses

ScopedMoment

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(timeline, offset) ⇒ OffsetTimeline

Returns a new instance of OffsetTimeline.



45
46
47
48
# File 'lib/bonito/timeline.rb', line 45

def initialize(timeline, offset)
  @offset = offset
  super timeline
end

Instance Attribute Details

#offsetObject (readonly)

Returns the value of attribute offset.



44
45
46
# File 'lib/bonito/timeline.rb', line 44

def offset
  @offset
end

Instance Method Details

#<=>(other) ⇒ Object



54
55
56
# File 'lib/bonito/timeline.rb', line 54

def <=>(other)
  offset <=> other.offset
end

#==(other) ⇒ Object



50
51
52
# File 'lib/bonito/timeline.rb', line 50

def ==(other)
  offset == other.offset && __getobj__ == other.__getobj__
end

#schedule(starting_offset, scope, opts = {}) ⇒ Object



58
59
60
# File 'lib/bonito/timeline.rb', line 58

def schedule(starting_offset, scope, opts = {})
  __getobj__.scheduler(starting_offset + offset, scope, opts)
end