Exception: Plutonium::Wizard::StepError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/plutonium/wizard/errors.rb

Overview

Raised when a wizard step fails. Carries the attribute the error should be attached to (defaults to :base) so it can be surfaced on a form.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, attribute: :base) ⇒ StepError

Returns a new instance of StepError.

Parameters:

  • message (String, nil) (defaults to: nil)

    the error message

  • attribute (Symbol) (defaults to: :base)

    the attribute the error applies to



21
22
23
24
# File 'lib/plutonium/wizard/errors.rb', line 21

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

Instance Attribute Details

#attributeSymbol (readonly)

Returns the attribute the error applies to.

Returns:

  • (Symbol)

    the attribute the error applies to



17
18
19
# File 'lib/plutonium/wizard/errors.rb', line 17

def attribute
  @attribute
end