Class: AdfBuilder::Nodes::Root
- Defined in:
- lib/adf_builder/nodes/node.rb
Instance Attribute Summary
Attributes inherited from Node
#attributes, #children, #tag_name, #value
Instance Method Summary collapse
- #first_prospect ⇒ Object
-
#prospect(&block) ⇒ Object
The root context of the builder.
Methods inherited from Node
#add_child, #initialize, #method_missing, #remove_children, #respond_to_missing?, #to_xml
Methods included from Validations
Constructor Details
This class inherits a constructor from AdfBuilder::Nodes::Node
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class AdfBuilder::Nodes::Node
Instance Method Details
#first_prospect ⇒ Object
76 77 78 |
# File 'lib/adf_builder/nodes/node.rb', line 76 def first_prospect @children.find { |c| c.is_a?(Prospect) } end |
#prospect(&block) ⇒ Object
The root context of the builder
70 71 72 73 74 |
# File 'lib/adf_builder/nodes/node.rb', line 70 def prospect(&block) prospect = Prospect.new prospect.instance_eval(&block) if block_given? add_child(prospect) end |