Module: CBOR_DIAG::Map3

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

Instance Method Summary collapse

Instance Method Details

#to_rbObject



2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
# File 'lib/cbor-diag-parser.rb', line 2731

def to_rb
  r = if e = a1.elements
    Hash.cbor_from_entries([e[0].to_rb] + e[2].elements.map {|x| x.kp.to_rb })
  else
    {}
  end
  if spec.is_stream?
    r.cbor_stream!
  end
  r
end