Exception: ViewComponent::ReservedParameterError

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

Constant Summary collapse

MESSAGE =
"COMPONENT initializer can't accept the parameter `PARAMETER`, as it will override a " \
"public ViewComponent method. To fix this issue, rename the parameter."

Instance Method Summary collapse

Constructor Details

#initialize(klass_name, parameter) ⇒ ReservedParameterError

Returns a new instance of ReservedParameterError.



79
80
81
# File 'lib/view_component/errors.rb', line 79

def initialize(klass_name, parameter)
  super(MESSAGE.gsub("COMPONENT", klass_name.to_s).gsub("PARAMETER", parameter.to_s))
end