Class: Stupidedi::TransactionSets::Builder::Dsl::SegmentBodyDSL
- Inherits:
-
Object
- Object
- Stupidedi::TransactionSets::Builder::Dsl::SegmentBodyDSL
- Includes:
- ElementSyntax, ValuesSyntax
- Defined in:
- lib/stupidedi/transaction_sets/builder/dsl.rb
Overview
A DSL for the body of a segment, which allows defining elements and using values lists.
Instance Attribute Summary collapse
-
#elements
Returns the value of attribute elements.
Instance Method Summary collapse
- #add_element(e)
-
#initialize(&block) ⇒ SegmentBodyDSL
constructor
A new instance of SegmentBodyDSL.
Methods included from ValuesSyntax
Methods included from ElementSyntax
Constructor Details
#initialize(&block) ⇒ SegmentBodyDSL
Returns a new instance of SegmentBodyDSL.
135 136 137 138 |
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 135 def initialize(&block) @elements = [] instance_eval(&block) end |
Instance Attribute Details
#elements
Returns the value of attribute elements.
144 145 146 |
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 144 def elements @elements end |
Instance Method Details
#add_element(e)
140 141 142 |
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 140 def add_element(e) @elements << e end |