Exception: ViewComponent::SlotPredicateNameError

Inherits:
InvalidSlotNameError show all
Defined in:
lib/view_component/errors.rb

Constant Summary collapse

MESSAGE =
"COMPONENT declares a slot named SLOT_NAME, which ends with a question mark.\n\n" \
"This isn't allowed because the ViewComponent framework already provides predicate " \
"methods ending in `?`.\n\n" \
"To fix this issue, choose a different name."

Instance Method Summary collapse

Constructor Details

#initialize(klass_name, slot_name) ⇒ SlotPredicateNameError

Returns a new instance of SlotPredicateNameError.



119
120
121
# File 'lib/view_component/errors.rb', line 119

def initialize(klass_name, slot_name)
  super(MESSAGE.gsub("COMPONENT", klass_name.to_s).gsub("SLOT_NAME", slot_name.to_s))
end