Class: Structor::Builder
- Inherits:
-
Object
- Object
- Structor::Builder
- Defined in:
- lib/structor/builder.rb
Instance Attribute Summary collapse
-
#nodes ⇒ Object
Returns the value of attribute nodes.
Instance Method Summary collapse
-
#initialize(&block) ⇒ Builder
constructor
A new instance of Builder.
- #optional(name, type = :hash, &block) ⇒ Object
- #requires(name, type = :hash, &block) ⇒ Object
Constructor Details
#initialize(&block) ⇒ Builder
Returns a new instance of Builder.
5 6 7 8 |
# File 'lib/structor/builder.rb', line 5 def initialize(&block) @nodes = {} instance_eval(&block) end |
Instance Attribute Details
#nodes ⇒ Object
Returns the value of attribute nodes.
3 4 5 |
# File 'lib/structor/builder.rb', line 3 def nodes @nodes end |