Module: CBOR_DIAG::Map3

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

Instance Method Summary collapse

Instance Method Details

#to_rbObject



2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
# File 'lib/cbor-diag-parser.rb', line 2810

def to_rb
  r = if e = a1.elements
    Hash[ [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