Module: Stupidedi::TransactionSets::Builder::Dsl::SegmentSyntax

Included in:
LoopBodyDSL, TableBodyDSL
Defined in:
lib/stupidedi/transaction_sets/builder/dsl.rb

Overview

Syntax for DSLs in which you can define segments.

Instance Method Summary collapse

Instance Method Details

#segment(pos, type, name, requirement, repeat, &block)



39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 39

def segment(pos, type, name, requirement, repeat, &block)
  elements = SegmentBodyDSL.new(&block).elements
  segment = Builder::Segment(
    pos,
    type,
    name,
    requirement,
    repeat,
    *elements
  )

  add_segment(segment)
end