Class: Shellfie::AnimationTimeline
- Inherits:
-
Object
- Object
- Shellfie::AnimationTimeline
- Defined in:
- lib/shellfie/animation_timeline.rb
Defined Under Namespace
Classes: Event
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(config) ⇒ AnimationTimeline
constructor
A new instance of AnimationTimeline.
Constructor Details
#initialize(config) ⇒ AnimationTimeline
Returns a new instance of AnimationTimeline.
7 8 9 |
# File 'lib/shellfie/animation_timeline.rb', line 7 def initialize(config) @config = config end |
Instance Method Details
#each ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/shellfie/animation_timeline.rb', line 11 def each return enum_for(:each) unless block_given? @config.frames.each do |frame| yield Event.new(kind: :command, frame: frame) if frame.type yield Event.new(kind: :output, frame: frame) if frame.output yield Event.new(kind: :pause, frame: frame) if pause_frame?(frame) end end |