Module: Gamefic::Scriptable::ClassMethods
- Included in:
- Gamefic::Subplot
- Defined in:
- lib/gamefic/scriptable.rb
Instance Method Summary collapse
-
#blocks ⇒ Array<Proc>
An array of blocks that were added by the
scriptclass method. -
#script(&block) ⇒ Object
Add a block to be executed by the instance’s
stagemethod.
Instance Method Details
#blocks ⇒ Array<Proc>
An array of blocks that were added by the script class method.
38 39 40 |
# File 'lib/gamefic/scriptable.rb', line 38 def blocks @blocks ||= [] end |
#script(&block) ⇒ Object
Add a block to be executed by the instance’s stage method.
Note that script does not execute the block instantly, but stores it in the blocks array to be executed later.
48 49 50 |
# File 'lib/gamefic/scriptable.rb', line 48 def script &block blocks.push block end |