Class: Cborb::Decoding::Types::Break

Inherits:
Type
  • Object
show all
Defined in:
lib/cborb/decoding/types/break.rb

Overview

To represent “break” stop code

Class Method Summary collapse

Methods inherited from Type

accept, indefinite?

Class Method Details

.decode(state, additional_info) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/cborb/decoding/types/break.rb', line 4

def self.decode(state, additional_info)
  unless state.stack_top.indefinite?
    raise Cborb::DecodingError, 'Unexpected "break" stop code'
  end

  state.accept_value(self, self)
end