Class: Flame::Validators::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.



61
62
63
64
65
66
67
68
# File 'lib/flame/validators.rb', line 61

def initialize(route_refine)
	@routes_actions = route_refine.routes.map { |route| route[: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

Returns:

  • (Boolean)


70
71
72
# File 'lib/flame/validators.rb', line 70

def valid?
	no_extra_routes_actions? && no_extra_controller_actions?
end