Class: GrapeTokenAuth::ResourceFinder
- Inherits:
-
Object
- Object
- GrapeTokenAuth::ResourceFinder
- Defined in:
- lib/grape_token_auth/resource/resource_finder.rb
Class Method Summary collapse
Instance Method Summary collapse
- #find_resource ⇒ Object
-
#initialize(scope, params) ⇒ ResourceFinder
constructor
A new instance of ResourceFinder.
Constructor Details
#initialize(scope, params) ⇒ ResourceFinder
Returns a new instance of ResourceFinder.
4 5 6 7 8 9 |
# File 'lib/grape_token_auth/resource/resource_finder.rb', line 4 def initialize(scope, params) @scope = scope @params = params set_resource_class set_finder_key end |
Class Method Details
.find(scope, params) ⇒ Object
11 12 13 |
# File 'lib/grape_token_auth/resource/resource_finder.rb', line 11 def self.find(scope, params) new(scope, params).find_resource end |
Instance Method Details
#find_resource ⇒ Object
15 16 17 18 |
# File 'lib/grape_token_auth/resource/resource_finder.rb', line 15 def find_resource return unless finder_key find_resource_by_key end |