Class: Stupidedi::Values::InvalidEnvelopeVal

Inherits:
AbstractVal show all
Extended by:
Forwardable
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

- (InvalidEnvelopeVal) initialize(children)

Returns a new instance of InvalidEnvelopeVal



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

def initialize(children)
  @children = children
end

Instance Attribute Details

- (Array<SegmentVal>) children (readonly)

Returns:



7
8
9
# File 'lib/stupidedi/values/invalid_envelope_val.rb', line 7

def children
  @children
end

Instance Method Details

- (SegmentVal) copy(changes = {})

Returns:



17
18
19
# File 'lib/stupidedi/values/invalid_envelope_val.rb', line 17

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

- (String) inspect

Returns:



55
56
57
58
# File 'lib/stupidedi/values/invalid_envelope_val.rb', line 55

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

- (Boolean) leaf?

Returns false

Returns:

  • (Boolean)

    false



27
28
29
# File 'lib/stupidedi/values/invalid_envelope_val.rb', line 27

def leaf?
  false
end

- pretty_print(q)

This method returns an undefined value.



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

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

- (Integer) size

Number of segments in this subtree

Returns:



22
23
24
# File 'lib/stupidedi/values/invalid_envelope_val.rb', line 22

def size
  0
end

- (Boolean) valid?

Returns:

  • (Boolean)


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

def valid?
  false
end