Exception: PlanMyStuff::ValidationError

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

Overview

Raised when custom field validation fails (Phase 1)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, field: nil, expected_type: nil) ⇒ ValidationError

Returns a new instance of ValidationError.

Parameters:

  • message (String) (defaults to: nil)
  • field (String, nil) (defaults to: nil)
  • expected_type (Symbol, nil) (defaults to: nil)


81
82
83
84
85
# File 'lib/plan_my_stuff/errors.rb', line 81

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

Instance Attribute Details

#expected_typeSymbol? (readonly)

Returns:

  • (Symbol, nil)


75
76
77
# File 'lib/plan_my_stuff/errors.rb', line 75

def expected_type
  @expected_type
end

#fieldString? (readonly)

Returns:

  • (String, nil)


72
73
74
# File 'lib/plan_my_stuff/errors.rb', line 72

def field
  @field
end