Class: Coppola::Scene

Inherits:
Object
  • Object
show all
Defined in:
lib/coppola/scene.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options, &block) ⇒ Scene

Returns a new instance of Scene.



7
8
9
10
# File 'lib/coppola/scene.rb', line 7

def initialize name, options, &block
  @name = name
  @block = block
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/coppola/scene.rb', line 5

def name
  @name
end

Instance Method Details

#run(actor) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/coppola/scene.rb', line 12

def run(actor)
  puts "Running scene '#{name}'..."
  resp = nil
  time = Benchmark.realtime do
    resp = @block.call(actor)
  end
  puts "Scene '#{name}' finished in #{time} seconds"
  resp
end