Class: Stupidedi::Values::InvalidEnvelopeVal

Inherits:
AbstractVal
  • Object
show all
Defined in:
lib/stupidedi/values/invalid_envelope_val.rb

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?, #table?, #transaction_set?, #transmission?

Methods included from Color

ansi, #ansi

Constructor Details

#initialize(children) ⇒ InvalidEnvelopeVal

Returns a new instance of InvalidEnvelopeVal



15
16
17
# File 'lib/stupidedi/values/invalid_envelope_val.rb', line 15

def initialize(children)
  @children = children
end

Instance Attribute Details

#childrenArray<SegmentVal> (readonly)

Returns:



11
12
13
# File 'lib/stupidedi/values/invalid_envelope_val.rb', line 11

def children
  @children
end

Instance Method Details

#copy(changes = {}) ⇒ SegmentVal

Returns:



20
21
22
# File 'lib/stupidedi/values/invalid_envelope_val.rb', line 20

def copy(changes = {})
  InvalidEnvelopeVal.new(changes.fetch(:children, @children))
end

#inspectString

Returns:

  • (String)


58
59
60
61
# File 'lib/stupidedi/values/invalid_envelope_val.rb', line 58

def inspect
  ansi.invalid("InvalidEnvelopeVal") <<
    "(#{@children.map(&:inspect).join(', ')})"
end

#leaf?Boolean

Returns false

Returns:

  • (Boolean)

    false



30
31
32
# File 'lib/stupidedi/values/invalid_envelope_val.rb', line 30

def leaf?
  false
end

#pretty_print(q)

This method returns an undefined value.



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/stupidedi/values/invalid_envelope_val.rb', line 39

def pretty_print(q)
  q.text(ansi.segment("InvalidEnvelopeVal"))
  q.group(2, "(", ")") do
    q.breakable ""
    q.text @children.first.reason
    q.text ","
    q.breakable

    @children.each do |e|
      unless q.current_group.first?
        q.text ","
        q.breakable
      end
      q.pp e
    end
  end
end

#sizeInteger

Number of segments in this subtree

Returns:

  • (Integer)


25
26
27
# File 'lib/stupidedi/values/invalid_envelope_val.rb', line 25

def size
  0
end

#valid?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/stupidedi/values/invalid_envelope_val.rb', line 34

def valid?
  false
end