Class: OctopusAuth::Queries::Get
- Inherits:
-
Object
- Object
- OctopusAuth::Queries::Get
- Defined in:
- lib/octopus_auth/queries/get.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(token) ⇒ Get
constructor
A new instance of Get.
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
#execute ⇒ Object
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 |