Class: Ruote::RubyDsl::BranchContext
- Inherits:
-
BlankSlate
- Object
- BlankSlate
- Ruote::RubyDsl::BranchContext
- Defined in:
- lib/ruote/reader/ruby_dsl.rb
Instance Method Summary collapse
-
#initialize(name, attributes) ⇒ BranchContext
constructor
A new instance of BranchContext.
- #method_missing(m, *args, &block) ⇒ Object
- #to_a ⇒ Object
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_a ⇒ Object
114 115 116 117 |
# File 'lib/ruote/reader/ruby_dsl.rb', line 114 def to_a [ @name, @attributes, @children ] end |