Module: CBOR_DIAG::Map3

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

Instance Method Summary collapse

Instance Method Details

#to_rbObject



2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
# File 'lib/cbor-diag-parser.rb', line 2771

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