Class: PersonalAccessTokensFinder

Inherits:
Object
  • Object
show all
Defined in:
app/finders/personal_access_tokens_finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}, current_user = nil) ⇒ PersonalAccessTokensFinder

Returns a new instance of PersonalAccessTokensFinder.


8
9
10
11
# File 'app/finders/personal_access_tokens_finder.rb', line 8

def initialize(params = {}, current_user = nil)
  @params = params
  @current_user = current_user
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params


4
5
6
# File 'app/finders/personal_access_tokens_finder.rb', line 4

def params
  @params
end

Instance Method Details

#executeObject


13
14
15
16
17
18
19
20
21
# File 'app/finders/personal_access_tokens_finder.rb', line 13

def execute
  tokens = PersonalAccessToken.all
  tokens = by_current_user(tokens)
  tokens = by_user(tokens)
  tokens = by_impersonation(tokens)
  tokens = by_state(tokens)

  sort(tokens)
end