Class: Guarda::PolicyFinder
- Inherits:
-
Object
- Object
- Guarda::PolicyFinder
- Defined in:
- lib/guarda/policy_finder.rb
Defined Under Namespace
Classes: NotFoundError
Class Method Summary collapse
Instance Method Summary collapse
- #find ⇒ Object
-
#initialize(controller_name) ⇒ PolicyFinder
constructor
A new instance of PolicyFinder.
Constructor Details
#initialize(controller_name) ⇒ PolicyFinder
Returns a new instance of PolicyFinder.
5 6 7 |
# File 'lib/guarda/policy_finder.rb', line 5 def initialize(controller_name) @controller_name = controller_name end |
Class Method Details
.find(controller_name) ⇒ Object
9 10 11 |
# File 'lib/guarda/policy_finder.rb', line 9 def self.find(controller_name) new(controller_name).find end |
Instance Method Details
#find ⇒ Object
13 14 15 |
# File 'lib/guarda/policy_finder.rb', line 13 def find policy_class.presence || raise(NotFoundError, policy_class_name) end |