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
A new instance of RouteExtraArgumentsError.
- #message ⇒ Object
Constructor Details
#initialize(ctrl, action, path, extra) ⇒ RouteExtraArgumentsError
Returns a new instance of RouteExtraArgumentsError.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/flame/errors/route_extra_arguments_error.rb', line 7 def initialize(ctrl, action, path, extra) @ctrl = ctrl @action = action @path = path @extra = extra @extra[:type_name] = { req: 'required', opt: 'optional' }[@extra[:type]] end |
Instance Method Details
#message ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/flame/errors/route_extra_arguments_error.rb', line 18 def case @extra[:place] when :ctrl ## Error if path has no arguments, that controller's method has ## NOTE: It isn't using because `Flame::Path#adopt` "Path '#{@path}' has no #{@extra[:type_name]}" \ " arguments #{@extra[:args].inspect}" when :path ## Error if path has more arguments, than controller's method "Action '#{@ctrl}##{@action}' has no #{@extra[:type_name]}" \ " arguments #{@extra[:args].inspect}" end end |