Class: Stupidedi::TransactionSets::Builder::Dsl::SegmentBodyDSL

Inherits:
Object
  • Object
show all
Includes:
ElementSyntax, ValuesSyntax
Defined in:
lib/stupidedi/transaction_sets/builder/dsl.rb

Overview

A DSL for the body of a segment, which allows defining elements and using values lists.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ValuesSyntax

#values

Methods included from ElementSyntax

#composite, #element

Constructor Details

#initialize(&block) ⇒ SegmentBodyDSL

Returns a new instance of SegmentBodyDSL.



135
136
137
138
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 135

def initialize(&block)
  @elements = []
  instance_eval(&block)
end

Instance Attribute Details

#elements

Returns the value of attribute elements.



144
145
146
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 144

def elements
  @elements
end

Instance Method Details

#add_element(e)



140
141
142
# File 'lib/stupidedi/transaction_sets/builder/dsl.rb', line 140

def add_element(e)
  @elements << e
end