Class: Stupidedi::TransactionSets::Builder::Dsl::TableBodyDSL

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 table, which allows defining segments and loops.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SegmentSyntax

#segment

Methods included from LoopSyntax

#loop_

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