Class: Shellfie::AnimationTimeline

Inherits:
Object
  • Object
show all
Defined in:
lib/shellfie/animation_timeline.rb

Defined Under Namespace

Classes: Event

Instance Method Summary collapse

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

#eachObject



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