class Cborb::Decoding::Types::IndefiniteMap

To represent major type: 5(indefinite-length)

@see tools.ietf.org/html/rfc7049#section-2.2.1

Public Class Methods

accept(im_data, type, value) click to toggle source
# File lib/cborb/decoding/types/indefinite_map.rb, line 14
def self.accept(im_data, type, value)
  if type == Cborb::Decoding::Types::Break
    raise Cborb::DecodingError, "Invalid indefinite-length map" if im_data.size.odd?
    Hash[*im_data]
  else
    im_data << value
    Cborb::Decoding::State::CONTINUE
  end
end
decode(state, additional_info) click to toggle source
# File lib/cborb/decoding/types/indefinite_map.rb, line 10
def self.decode(state, additional_info)
  state.push_stack(self, [])
end
indefinite?() click to toggle source
# File lib/cborb/decoding/types/indefinite_map.rb, line 6
def self.indefinite?
  true
end