Class: Stupidedi::Schema::TransactionSetDef
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Inspect
#inspect
Methods inherited from AbstractDef
#component?, #composite?, #definition?, #element?, #functional_group?, #interchange?, #loop?, #repeated?, #segment?, #simple?, #table?, #transaction_set?, #usage?
Constructor Details
#initialize(functional_group, id, name, table_defs) ⇒ TransactionSetDef
Returns a new instance of TransactionSetDef.
23
24
25
26
27
28
|
# File 'lib/stupidedi/schema/transaction_set_def.rb', line 23
def initialize(functional_group, id, name, table_defs)
@functional_group, @id, @name, @table_defs =
functional_group, id, name, table_defs
@table_defs = table_defs.map{|x| x.copy(:parent => self) }
end
|
Instance Attribute Details
#functional_group ⇒ String
18
19
20
|
# File 'lib/stupidedi/schema/transaction_set_def.rb', line 18
def functional_group
@functional_group
end
|
#id ⇒ String
12
13
14
|
# File 'lib/stupidedi/schema/transaction_set_def.rb', line 12
def id
@id
end
|
#name ⇒ String
15
16
17
|
# File 'lib/stupidedi/schema/transaction_set_def.rb', line 15
def name
@name
end
|
#table_defs ⇒ Array<TableDef>
21
22
23
|
# File 'lib/stupidedi/schema/transaction_set_def.rb', line 21
def table_defs
@table_defs
end
|
Class Method Details
.build(functional_group, id, name, *table_defs) ⇒ TransactionSetDef
86
87
88
|
# File 'lib/stupidedi/schema/transaction_set_def.rb', line 86
def build(functional_group, id, name, *table_defs)
new(functional_group, id, name, table_defs)
end
|
Instance Method Details
#code_lists ⇒ AbstractSet<CodeList>
63
64
65
|
# File 'lib/stupidedi/schema/transaction_set_def.rb', line 63
def code_lists
@table_defs.map(&:code_lists).inject(&:|)
end
|
#copy(changes = {}) ⇒ Object
30
31
32
33
34
35
36
|
# File 'lib/stupidedi/schema/transaction_set_def.rb', line 30
def copy(changes = {})
TransactionSetDef.new \
changes.fetch(:functional_group, @functional_group),
changes.fetch(:id, @id),
changes.fetch(:name, @name),
changes.fetch(:table_defs, @table_defs)
end
|
#entry_segment_use ⇒ SegmentUse
44
45
46
|
# File 'lib/stupidedi/schema/transaction_set_def.rb', line 44
def entry_segment_use
@table_defs.head..head
end
|
#first_segment_use ⇒ SegmentUse
49
50
51
|
# File 'lib/stupidedi/schema/transaction_set_def.rb', line 49
def first_segment_use
@table_defs.head..head
end
|
54
55
56
|
# File 'lib/stupidedi/schema/transaction_set_def.rb', line 54
def last_segment_use
@table_defs.last.trailer_segment_uses.last
end
|
#pretty_print(q) ⇒ void
This method returns an undefined value.
68
69
70
71
72
73
74
75
76
77
78
79
80
|
# File 'lib/stupidedi/schema/transaction_set_def.rb', line 68
def pretty_print(q)
q.text("TransactionSetDef[#{@functional_group}#{@id}]")
q.group(2, "(", ")") do
q.breakable ""
@table_defs.each do |e|
unless q.current_group.first?
q.text ","
q.breakable
end
q.pp e
end
end
end
|
#transaction? ⇒ Boolean
58
59
60
|
# File 'lib/stupidedi/schema/transaction_set_def.rb', line 58
def transaction?
true
end
|