Class: Stupidedi::Values::TransactionSetVal
Instance Attribute Summary collapse
Instance Method Summary
collapse
#leaf?
Methods inherited from AbstractVal
#blank?, #characters, #component?, #composite?, #element?, #empty?, #functional_group?, #interchange?, #invalid?, #loop?, #present?, #repeated?, #segment?, #separator?, #simple?, #size, #table?, #transmission?, #valid?
Methods included from Color
ansi, #ansi
Constructor Details
#initialize(definition, children) ⇒ TransactionSetVal
Returns a new instance of TransactionSetVal.
16
17
18
19
|
# File 'lib/stupidedi/values/transaction_set_val.rb', line 16
def initialize(definition, children)
@definition, @children =
definition, children
end
|
Instance Attribute Details
11
12
13
|
# File 'lib/stupidedi/values/transaction_set_val.rb', line 11
def children
@children
end
|
#definition ⇒ TransactionSetDef
8
9
10
|
# File 'lib/stupidedi/values/transaction_set_val.rb', line 8
def definition
@definition
end
|
Instance Method Details
#==(other) ⇒ Boolean
59
60
61
62
63
|
# File 'lib/stupidedi/values/transaction_set_val.rb', line 59
def ==(other)
eql?(other) or
(other.definition == @definition and
other.children == @children)
end
|
22
23
24
25
26
|
# File 'lib/stupidedi/values/transaction_set_val.rb', line 22
def copy(changes = {})
TransactionSetVal.new \
changes.fetch(:definition, @definition),
changes.fetch(:children, @children)
end
|
54
55
56
|
# File 'lib/stupidedi/values/transaction_set_val.rb', line 54
def inspect
ansi.envelope("Transaction") << "(#{@children.map(&:inspect).join(', ')})"
end
|
#pretty_print(q) ⇒ void
This method returns an undefined value.
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/stupidedi/values/transaction_set_val.rb', line 35
def pretty_print(q)
id = @definition.try do |d|
ansi.bold("[#{d.functional_group}#{d.id}]")
end
q.text(ansi.envelope("TransactionSetVal#{id}"))
q.group(2, "(", ")") do
q.breakable ""
@children.each do |e|
unless q.current_group.first?
q.text ","
q.breakable
end
q.pp e
end
end
end
|
#transaction_set? ⇒ Boolean
30
31
32
|
# File 'lib/stupidedi/values/transaction_set_val.rb', line 30
def transaction_set?
true
end
|