Method: LSystem::RulesEngine#initialize

Defined in:
lib/l_system/rules_engine.rb

#initialize(&block) ⇒ RulesEngine

Create a new rules engine for an L-System. If the block is present, it is called with the new instance as self.



22
23
24
25
26
27
28
29
30
31
# File 'lib/l_system/rules_engine.rb', line 22

def initialize( &block )
  @variables = Set.new
  @constants = Set.new
  @axiom = nil
  @rules = []

  @rules_as_hash = nil

  self.instance_eval( &block ) if block
end