Class: Coppola::Scene
- Inherits:
-
Object
- Object
- Coppola::Scene
- Defined in:
- lib/coppola/scene.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, options, &block) ⇒ Scene
constructor
A new instance of Scene.
- #run(actor) ⇒ Object
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, , &block @name = name @block = block end |
Instance Attribute Details
#name ⇒ Object (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 |