Class: Interaktor::Error::OrganizerMissingPassedAttributeError

Inherits:
AttributeError
  • Object
show all
Defined in:
lib/interaktor/error/organizer_missing_passed_attribute_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(interaktor, attribute) ⇒ OrganizerMissingPassedAttributeError

Returns a new instance of OrganizerMissingPassedAttributeError.

Parameters:

  • next_interaktor (Class)
  • attribute (Symbol, String)


7
8
9
10
11
# File 'lib/interaktor/error/organizer_missing_passed_attribute_error.rb', line 7

def initialize(interaktor, attribute)
  super(interaktor, [attribute.to_s])

  @attribute = attribute.to_s
end

Instance Attribute Details

#attributeString (readonly)

Returns:

  • (String)


3
4
5
# File 'lib/interaktor/error/organizer_missing_passed_attribute_error.rb', line 3

def attribute
  @attribute
end

Instance Method Details

#messageObject



13
14
15
16
17
18
19
20
# File 'lib/interaktor/error/organizer_missing_passed_attribute_error.rb', line 13

def message
  <<~MESSAGE.strip.tr("\n", " ")
    An organized #{interaktor} interaktor defines a '#{attribute}' input
    attribute, but none of the interaktors that come before it in the
    organizer list it as a success attribute, and the organizer does not
    define it as an input attribute.
  MESSAGE
end