class BSON::Binary::InvalidType

Raised when providing an invalid type to the Binary.

@since 2.0.0

Attributes

type[R]

@!attribute type

@return [ Object ] The invalid type.
@since 2.0.0

Public Class Methods

new(type) click to toggle source

Instantiate the new error.

@example Instantiate the error.

InvalidType.new(:error)

@param [ Object ] type The invalid type.

@since 2.0.0

# File lib/bson/binary.rb, line 178
def initialize(type)
  @type = type
end

Public Instance Methods

message() click to toggle source

Get the custom error message for the exception.

@example Get the message.

error.message

@return [ String ] The error message.

@since 2.0.0

# File lib/bson/binary.rb, line 190
def message
  "#{type.inspect} is not a valid binary type. " +
    "Please use one of #{SUBTYPES.keys.map(&:inspect).join(", ")}."
end