Class: Stupidedi::Values::TransmissionVal
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from AbstractVal
#blank?, #characters, #component?, #composite?, #definition, #element?, #empty?, #functional_group?, #interchange?, #invalid?, #loop?, #present?, #repeated?, #segment?, #separator?, #simple?, #size, #table?, #transaction_set?, #valid?
Methods included from Color
ansi, #ansi
Constructor Details
Returns a new instance of TransmissionVal.
13
14
15
|
# File 'lib/stupidedi/values/transmission_val.rb', line 13
def initialize(children = [])
@children = children
end
|
Instance Attribute Details
11
12
13
|
# File 'lib/stupidedi/values/transmission_val.rb', line 11
def children
@children
end
|
Instance Method Details
#==(other) ⇒ Boolean
30
31
32
|
# File 'lib/stupidedi/values/transmission_val.rb', line 30
def ==(other)
eql?(other) or other.children == @children
end
|
#copy(changes = {}) ⇒ Object
17
18
19
|
# File 'lib/stupidedi/values/transmission_val.rb', line 17
def copy(changes = {})
TransmissionVal.new(changes.fetch(:children, @children))
end
|
#inspect ⇒ String
50
51
52
|
# File 'lib/stupidedi/values/transmission_val.rb', line 50
def inspect
ansi.envelope("TransmissionVal") << "(#{@children.map(&:inspect).join(', ')})"
end
|
#leaf? ⇒ Boolean
21
22
23
|
# File 'lib/stupidedi/values/transmission_val.rb', line 21
def leaf?
false
end
|
#pretty_print(q) ⇒ void
This method returns an undefined value.
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/stupidedi/values/transmission_val.rb', line 35
def pretty_print(q)
q.text(ansi.envelope("TransmissionVal"))
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
|
#transmission? ⇒ Boolean
25
26
27
|
# File 'lib/stupidedi/values/transmission_val.rb', line 25
def transmission?
true
end
|