Class: IMS::LTI::Services::OAuth2Client

Inherits:
Object
  • Object
show all
Defined in:
lib/ims/lti/services/oauth2_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token:, base_url: nil) ⇒ OAuth2Client

Returns a new instance of OAuth2Client.



7
8
9
10
# File 'lib/ims/lti/services/oauth2_client.rb', line 7

def initialize(token:, base_url: nil)
  @base_url = base_url
  @token = token
end

Instance Attribute Details

#base_urlObject

Returns the value of attribute base_url.



4
5
6
# File 'lib/ims/lti/services/oauth2_client.rb', line 4

def base_url
  @base_url
end

#connectionObject



12
13
14
15
16
# File 'lib/ims/lti/services/oauth2_client.rb', line 12

def connection
  @connection ||= Faraday.new base_url do |conn|
    conn.authorization :Bearer, token
  end
end

#tokenObject

Returns the value of attribute token.



4
5
6
# File 'lib/ims/lti/services/oauth2_client.rb', line 4

def token
  @token
end