Class: Tarquinn::Condition::ActionChecker
- Inherits:
-
Object
- Object
- Tarquinn::Condition::ActionChecker
- Defined in:
- lib/tarquinn/condition/action_checker.rb
Instance Attribute Summary collapse
-
#routes ⇒ Object
Returns the value of attribute routes.
Instance Method Summary collapse
- #check?(controller) ⇒ Boolean
-
#initialize(routes) ⇒ ActionChecker
constructor
A new instance of ActionChecker.
Constructor Details
#initialize(routes) ⇒ ActionChecker
Returns a new instance of ActionChecker.
4 5 6 |
# File 'lib/tarquinn/condition/action_checker.rb', line 4 def initialize(routes) @routes = [routes].flatten.map(&:to_s) end |
Instance Attribute Details
#routes ⇒ Object
Returns the value of attribute routes.
2 3 4 |
# File 'lib/tarquinn/condition/action_checker.rb', line 2 def routes @routes end |
Instance Method Details
#check?(controller) ⇒ Boolean
8 9 10 |
# File 'lib/tarquinn/condition/action_checker.rb', line 8 def check?(controller) routes.include? controller.params[:action] end |