Class: Flame::ActionsValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/flame/validators.rb

Overview

Compare actions from routes and from controller

Instance Method Summary collapse

Constructor Details

#initialize(route_refine) ⇒ ActionsValidator

Returns a new instance of ActionsValidator.



60
61
62
63
# File 'lib/flame/validators.rb', line 60

def initialize(route_refine)
	@routes = route_refine.routes
	@ctrl = route_refine.ctrl
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


65
66
67
68
69
# File 'lib/flame/validators.rb', line 65

def valid?
	@routes_actions = @routes.map { |route| route[:action] }
	@ctrl_actions = @ctrl.public_instance_methods(false)
	no_extra_routes_actions? && no_extra_controller_actions?
end