Module: Stupidedi::TransactionSets::Builder::Dsl::ElementSyntax

Included in:
SegmentBodyDSL
Defined in:
lib/stupidedi/transaction_sets/builder/dsl.rb

Overview

Syntax for DSLs in which you can define elements.

Instance Method Summary collapse

Instance Method Details

#composite(*args, &block)

Define a composite element within this block, using a sub-block for the sub-elements


28
29
30
31
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 28

def composite(*args, &block)
  subelements = SegmentBodyDSL.new(&block).elements
  add_element(Builder::Element(*(args + subelements)))
end

#element(*args)

Define an element within this block


22
23
24
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 22

def element(*args)
  add_element(Builder::Element(*args))
end