Class: Ruote::RubyDsl::BranchContext

Inherits:
BlankSlate show all
Defined in:
lib/ruote/reader/ruby_dsl.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, attributes) ⇒ BranchContext

Returns a new instance of BranchContext.



102
103
104
105
106
107
# File 'lib/ruote/reader/ruby_dsl.rb', line 102

def initialize(name, attributes)

  @name = name
  @attributes = attributes
  @children = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object



109
110
111
112
# File 'lib/ruote/reader/ruby_dsl.rb', line 109

def method_missing(m, *args, &block)

  @children.push(Ruote::RubyDsl.create_branch(m.to_s, args, &block))
end

Instance Method Details

#to_aObject



114
115
116
117
# File 'lib/ruote/reader/ruby_dsl.rb', line 114

def to_a

  [ @name, @attributes, @children ]
end