Module: Gamefic::Subplot::Host

Defined in:
lib/gamefic/subplot.rb

Instance Method Summary collapse

Instance Method Details

#branch(subplot_class, feature: nil, &block) ⇒ Subplot

Start a new subplot based on the provided class.

Parameters:

  • The (Class)

    class of the subplot to be created (Subplot by default)

Returns:



28
29
30
31
32
# File 'lib/gamefic/subplot.rb', line 28

def branch subplot_class, feature:nil, &block
  subplot = subplot_class.new(self, feature: feature, &block)
  p_subplots.push subplot
  subplot
end

#subplotsArray<Subplot>

Get an array of all the current subplots.

Returns:



20
21
22
# File 'lib/gamefic/subplot.rb', line 20

def subplots
  p_subplots.clone
end