Exception: Crockford32::LengthTooSmallError

Inherits:
EncodeError show all
Defined in:
lib/crockford32/errors.rb

Overview

An error representing the length of an encoded value being larger than the requested maximum length.

Since:

  • 1.0.0

Instance Method Summary collapse

Constructor Details

#initialize(value, needed, given) ⇒ LengthTooSmallError

Returns a new instance of LengthTooSmallError.

Parameters:

  • value (Integer, String)

    the value to be encoded.

  • needed (Integer)

    the needed length to encode the value.

  • given (Integer)

    the specified length to encode the value.

Since:

  • 1.0.0



19
20
21
# File 'lib/crockford32/errors.rb', line 19

def initialize(value, needed, given)
  super("Encoding #{value} requires a minimum length of #{needed}, but received #{given}")
end