Sha256: edf6a6494aa1916590cf09e1a8dd1715a66b8de56a957f3870208579acec5964

Contents?: true

Size: 350 Bytes

Versions: 3

Compression:

Stored size: 350 Bytes

Contents

module Cborb::Decoding::Types
  # To represent major type: 1
  #
  # @see https://tools.ietf.org/html/rfc7049#section-2.1
  class NegativeInteger < Type
    extend Cborb::Decoding::Types::IntegerDecodable

    def self.decode(state, additional_info)
      state.accept_value(self, -(consume_as_integer(state, additional_info) + 1))
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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