module Gamefic::Scriptable::ClassMethods

Public Instance Methods

blocks() click to toggle source

An array of blocks that were added by the `script` class method.

@return [Array<Proc>]

# File lib/gamefic/scriptable.rb, line 38
def blocks
  @blocks ||= []
end
script(&block) click to toggle source

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.

@yieldpublic [Gamefic::Plot]

# File lib/gamefic/scriptable.rb, line 48
def script &block
  blocks.push block
end