Method: Moonrope::Structure#initialize

Defined in:
lib/moonrope/structure.rb

#initialize(base, name) { ... } ⇒ Structure

Initialize a new structure

Parameters:

Yields:

  • instance evals the contents within the structure DSL



36
37
38
39
40
41
42
43
# File 'lib/moonrope/structure.rb', line 36

def initialize(base, name, &block)
  @base = base
  @name = name
  @expansions = {}
  @attributes = {:basic => [], :full => [], :expansion => []}
  @dsl = Moonrope::DSL::StructureDSL.new(self)
  @dsl.instance_eval(&block) if block_given?
end