Exception: Israeli::InvalidFormatError

Inherits:
Error
  • Object
show all
Defined in:
lib/israeli/errors.rb

Overview

Raised when input format is invalid for the requested validation type.

Examples:

Israeli.valid_id!("123456789")
# => Israeli::InvalidFormatError: Invalid Israeli ID

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, reason: nil) ⇒ InvalidFormatError

Returns a new instance of InvalidFormatError.

Parameters:

  • message (String) (defaults to: nil)

    Human-readable error message

  • reason (Symbol, nil) (defaults to: nil)

    Machine-readable reason code



26
27
28
29
# File 'lib/israeli/errors.rb', line 26

def initialize(message = nil, reason: nil)
  @reason = reason
  super(message)
end

Instance Attribute Details

#reasonObject (readonly)

Returns the value of attribute reason.



22
23
24
# File 'lib/israeli/errors.rb', line 22

def reason
  @reason
end