Exception: ActiveInteractor::Error::InvalidContextClass

Inherits:
StandardError
  • Object
show all
Defined in:
lib/active_interactor/error.rb

Overview

Raised when an invalid context class is assigned to an interactor.

Since:

  • 1.0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(class_name = nil) ⇒ InvalidContextClass

Parameters:

  • class_name (String) (defaults to: nil)

    the context class name

Since:

  • 1.0.0


32
33
34
35
# File 'lib/active_interactor/error.rb', line 32

def initialize(class_name = nil)
  @class_name = class_name
  super("invalid context class #{class_name}")
end

Instance Attribute Details

#class_nameString|nil (readonly)

Returns the class name of the context.

Returns:

  • (String|nil)

    the class name of the context

Since:

  • 1.0.0


27
28
29
30
31
32
33
34
35
36
# File 'lib/active_interactor/error.rb', line 27

class InvalidContextClass < StandardError
  attr_reader :class_name

  # @param class_name [String] the context class name
  # @return [InvalidContextClass] a new instance of {InvalidContextClass}
  def initialize(class_name = nil)
    @class_name = class_name
    super("invalid context class #{class_name}")
  end
end