Class: Flame::Validators::ActionsValidator
- Inherits:
-
Object
- Object
- Flame::Validators::ActionsValidator
- Defined in:
- lib/flame/validators.rb
Overview
Compare actions from routes and from controller
Instance Method Summary collapse
-
#initialize(route_refine) ⇒ ActionsValidator
constructor
A new instance of ActionsValidator.
- #valid? ⇒ Boolean
Constructor Details
#initialize(route_refine) ⇒ ActionsValidator
Returns a new instance of ActionsValidator.
65 66 67 68 69 70 71 72 |
# File 'lib/flame/validators.rb', line 65 def initialize(route_refine) @routes_actions = route_refine.routes.map(&:action) @ctrl = route_refine.ctrl @ctrl_actions = { public: @ctrl.public_instance_methods(false), all: @ctrl.instance_methods + @ctrl.private_instance_methods } end |
Instance Method Details
#valid? ⇒ Boolean
74 75 76 |
# File 'lib/flame/validators.rb', line 74 def valid? no_extra_routes_actions? && no_extra_controller_actions? end |