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.



81
82
83
# File 'lib/view_component/errors.rb', line 81

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