Class: AdfBuilder::Nodes::Root

Inherits:
Node
  • Object
show all
Defined in:
lib/adf_builder/nodes/node.rb

Instance Attribute Summary

Attributes inherited from Node

#attributes, #children, #tag_name, #value

Instance Method Summary collapse

Methods inherited from Node

#add_child, #initialize, #method_missing, #remove_children, #respond_to_missing?, #to_xml

Methods included from Validations

included, #validate!

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_prospectObject



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