Exception: ViewComponent::RedefinedSlotError

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

Constant Summary collapse

MESSAGE =
"COMPONENT declares the SLOT_NAME slot multiple times.\n\n" \
"To fix this issue, choose a different slot name."

Instance Method Summary collapse

Constructor Details

#initialize(klass_name, slot_name) ⇒ RedefinedSlotError

Returns a new instance of RedefinedSlotError.



127
128
129
# File 'lib/view_component/errors.rb', line 127

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