Class: DocusignDtr::Auth::Base

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/docusign_dtr/auth/base.rb

Direct Known Subclasses

Code, Jwt

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



10
11
12
# File 'lib/docusign_dtr/auth/base.rb', line 10

def initialize
  @config = DocusignDtr::Models::AuthConfig.new
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



8
9
10
# File 'lib/docusign_dtr/auth/base.rb', line 8

def config
  @config
end

#token_responseObject

Returns the value of attribute token_response.



8
9
10
# File 'lib/docusign_dtr/auth/base.rb', line 8

def token_response
  @token_response
end

Instance Method Details

#grant_urlObject



14
15
16
17
18
# File 'lib/docusign_dtr/auth/base.rb', line 14

def grant_url
  grant_uri = URI("#{base_uri}oauth/auth")
  grant_uri.query = URI.encode_www_form(grant_params)
  grant_uri.to_s
end

#parse_url_response(url) ⇒ Object



20
21
22
23
24
# File 'lib/docusign_dtr/auth/base.rb', line 20

def parse_url_response(url)
  params = URI.decode_www_form(URI(url).query)
  hash = Hash[*params.flatten]
  OpenStruct.new(hash) # rubocop:disable Style/OpenStructUse
end