Class: Stupidedi::TransactionSets::Builder::Dsl::LoopBodyDSL

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Methods included from SegmentSyntax

#segment

Methods included from LoopSyntax

#loop_

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