Sha256: 57e09d4cdddcbb8be7aae1f3cb749ca4950e0af4ad9cdf9060b61b163d4b73c0

Contents?: true

Size: 424 Bytes

Versions: 3

Compression:

Stored size: 424 Bytes

Contents

module Cborb::Decoding::Types
  # To represent major type: 3(definite-length)
  #
  # @see https://tools.ietf.org/html/rfc7049#section-2.1
  class TextString < Type
    extend Cborb::Decoding::Types::IntegerDecodable

    def self.decode(state, additional_info)
      bytes = state.consume(consume_as_integer(state, additional_info))
      state.accept_value(self, bytes.force_encoding(::Encoding::UTF_8))
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cborb-0.3.0 lib/cborb/decoding/types/text_string.rb
cborb-0.2.0 lib/cborb/decoding/types/text_string.rb
cborb-0.1.0 lib/cborb/decoding/types/text_string.rb