Class: GrapeTokenAuth::ResourceFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/grape_token_auth/resource/resource_finder.rb

Class Method Summary collapse

Instance Method Summary collapse

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_resourceObject



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