class BSON::Error::InvalidBinaryType
Raised when providing an invalid type to the Binary
.
Attributes
type[R]
@return [ Object
] The invalid type.
Public Class Methods
new(type)
click to toggle source
Instantiate the new error.
@example Instantiate the error.
InvalidBinaryType.new(:error)
@param [ Object
] type The invalid type.
@api private
# File lib/bson/error/invalid_binary_type.rb, line 21 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.
# File lib/bson/error/invalid_binary_type.rb, line 31 def message "#{type.inspect} is not a valid binary type. " + "Please use one of #{BSON::Binary::SUBTYPES.keys.map(&:inspect).join(", ")}." end