class Cborb::Decoding::Types::IndefiniteTextString

To represent major type: 3(indefinite-length)

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

Public Class Methods

accept(im_data, type, value) click to toggle source
# File lib/cborb/decoding/types/indefinite_text_string.rb, line 14
def self.accept(im_data, type, value)
  if type == Cborb::Decoding::Types::TextString
    im_data.concat(value)
    Cborb::Decoding::State::CONTINUE
  elsif type == Cborb::Decoding::Types::Break
    im_data
  else
    raise Cborb::DecodingError, "Unexpected chunk for indefinite text string"
  end
end
decode(state, additional_info) click to toggle source
# File lib/cborb/decoding/types/indefinite_text_string.rb, line 10
def self.decode(state, additional_info)
  state.push_stack(self, String.new.force_encoding(::Encoding::UTF_8))
end
indefinite?() click to toggle source
# File lib/cborb/decoding/types/indefinite_text_string.rb, line 6
def self.indefinite?
  true
end