Module: CBOR_DIAG::Text3

Defined in:
lib/cbor-diag-parser.rb

Instance Method Summary collapse

Instance Method Details

#to_rbObject



54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/cbor-diag-parser.rb', line 54

def to_rb
  r = if e = a1.elements
    [e[0].to_rb] + e[2].elements.map {|x| x.value.to_rb }
  else
    []
  end
  if r.size == 1
    r.first
  else
    CBOR::Sequence.new(r)
  end
end