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.



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

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.



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

def token_response
  @token_response
end

Instance Method Details

#grant_urlObject



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

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



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

def parse_url_response(url)
  params = URI.decode_www_form(URI(url).query)
  hash = Hash[*params.flatten]
  OpenStruct.new(hash)
end