Class: OctopusAuth::Queries::Get

Inherits:
Object
  • Object
show all
Defined in:
lib/octopus_auth/queries/get.rb

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ Get

Returns a new instance of Get.



4
5
6
# File 'lib/octopus_auth/queries/get.rb', line 4

def initialize(token)
  @token = token
end

Instance Method Details

#executeObject



8
9
10
11
12
13
14
15
# File 'lib/octopus_auth/queries/get.rb', line 8

def execute
  return nil if @token.nil?

  access_token = OctopusAuth.configuration.model_class.where(token: @token).first
  return nil if access_token.nil?

  OctopusAuth::Decorators::Default.new(access_token)
end