Class: Stupidedi::TransactionSets::Builder::Dsl::TableBodyDSL
- Inherits:
-
Object
- Object
- Stupidedi::TransactionSets::Builder::Dsl::TableBodyDSL
- Includes:
- LoopSyntax, SegmentSyntax
- Defined in:
- lib/stupidedi/transaction_sets/builder/dsl.rb
Overview
A DSL for the body of a table, which allows defining segments and loops.
Instance Attribute Summary collapse
-
#elements
Returns the value of attribute elements.
Instance Method Summary collapse
- #add_loop(l)
- #add_segment(segment)
-
#initialize(&block) ⇒ TableBodyDSL
constructor
A new instance of TableBodyDSL.
Methods included from SegmentSyntax
Methods included from LoopSyntax
Constructor Details
#initialize(&block) ⇒ TableBodyDSL
Returns a new instance of TableBodyDSL.
154 155 156 157 |
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 154 def initialize(&block) @elements = [] instance_eval(&block) end |
Instance Attribute Details
#elements
Returns the value of attribute elements.
167 168 169 |
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 167 def elements @elements end |
Instance Method Details
#add_loop(l)
159 160 161 |
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 159 def add_loop(l) @elements << l end |
#add_segment(segment)
163 164 165 |
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 163 def add_segment(segment) @elements << segment end |