Class: Stupidedi::TransactionSets::Builder::Dsl::LoopBodyDSL
- Inherits:
-
Object
- Object
- Stupidedi::TransactionSets::Builder::Dsl::LoopBodyDSL
- Includes:
- LoopSyntax, SegmentSyntax
- Defined in:
- lib/stupidedi/transaction_sets/builder/dsl.rb
Overview
A DSL for the body of a loop, which allows defining loops and segments
Instance Attribute Summary collapse
-
#elements
Returns the value of attribute elements.
Instance Method Summary collapse
- #add_loop(loop_)
- #add_segment(segment)
-
#initialize(&block) ⇒ LoopBodyDSL
constructor
A new instance of LoopBodyDSL.
Methods included from SegmentSyntax
Methods included from LoopSyntax
Constructor Details
#initialize(&block) ⇒ LoopBodyDSL
Returns a new instance of LoopBodyDSL.
110 111 112 113 |
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 110 def initialize(&block) @elements = [] instance_eval(&block) end |
Instance Attribute Details
#elements
Returns the value of attribute elements.
115 116 117 |
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 115 def elements @elements end |
Instance Method Details
#add_loop(loop_)
117 118 119 |
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 117 def add_loop(loop_) elements << loop_ end |
#add_segment(segment)
121 122 123 |
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 121 def add_segment(segment) elements << segment end |