Class: Apill::Authorizers::Scope

Inherits:
Object
  • Object
show all
Defined in:
lib/apill/authorizers/scope.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token:, user:, params:, scoped_user_id:, scope_root:, **other) ⇒ Scope

rubocop:disable Metrics/ParameterLists



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/apill/authorizers/scope.rb', line 11

def initialize(token:, user:, params:, scoped_user_id:, scope_root:, **other)
  self.token          = token
  self.user           = user
  self.params         = params
  self.scoped_user_id = scoped_user_id
  self.scope_root     = scope_root

  other.each do |name, value|
    public_send("#{name}=", value)
  end
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



4
5
6
# File 'lib/apill/authorizers/scope.rb', line 4

def params
  @params
end

#scope_rootObject

Returns the value of attribute scope_root.



4
5
6
# File 'lib/apill/authorizers/scope.rb', line 4

def scope_root
  @scope_root
end

#scoped_user_idObject

Returns the value of attribute scoped_user_id.



4
5
6
# File 'lib/apill/authorizers/scope.rb', line 4

def scoped_user_id
  @scoped_user_id
end

#tokenObject

Returns the value of attribute token.



4
5
6
# File 'lib/apill/authorizers/scope.rb', line 4

def token
  @token
end

#userObject

Returns the value of attribute user.



4
5
6
# File 'lib/apill/authorizers/scope.rb', line 4

def user
  @user
end

Instance Method Details

#callObject

rubocop:enable Metrics/ParameterLists



24
25
26
# File 'lib/apill/authorizers/scope.rb', line 24

def call
  scope_root.none
end