Class: Flame::ArgumentsValidator
- Inherits:
-
Object
- Object
- Flame::ArgumentsValidator
- Defined in:
- lib/flame/validators.rb
Overview
Compare arguments from path and from controller’s action
Instance Method Summary collapse
-
#initialize(ctrl, path, action) ⇒ ArgumentsValidator
constructor
A new instance of ArgumentsValidator.
- #valid? ⇒ Boolean
Constructor Details
#initialize(ctrl, path, action) ⇒ ArgumentsValidator
Returns a new instance of ArgumentsValidator.
6 7 8 9 10 |
# File 'lib/flame/validators.rb', line 6 def initialize(ctrl, path, action) @ctrl = ctrl @path = path @action = action end |
Instance Method Details
#valid? ⇒ Boolean
12 13 14 15 16 17 18 19 |
# File 'lib/flame/validators.rb', line 12 def valid? ## Break path for ':arg' arguments @path_args = path_arguments(@path) ## Take all and required arguments from Controller#action @action_args = action_arguments(@action) ## Compare arguments from path and arguments from method no_extra_path_arguments? && no_extra_action_arguments? end |