Exception: Flame::Errors::RouteExtraArgumentsError
- Inherits:
-
StandardError
- Object
- StandardError
- Flame::Errors::RouteExtraArgumentsError
- Defined in:
- lib/flame/errors/route_extra_arguments_error.rb
Overview
Error for Route initialization
Instance Method Summary collapse
-
#initialize(ctrl, action, path, extra) ⇒ RouteExtraArgumentsError
constructor
Create a new instance of error.
Constructor Details
#initialize(ctrl, action, path, extra) ⇒ RouteExtraArgumentsError
Create a new instance of error
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/flame/errors/route_extra_arguments_error.rb', line 15 def initialize(ctrl, action, path, extra) extra[:type_name] = { req: 'required', opt: 'optional' }[extra[:type]] entity = { ## Error if path has no arguments, that controller's method has ## NOTE: It isn't using because `Flame::Path#adopt` ctrl: "Path '#{path}'", ## Error if path has more arguments, than controller's method path: "Action '#{ctrl}##{action}'" }[extra[:place]] super("#{entity} has no #{extra[:type_name]} arguments #{extra[:args].inspect}") end |