Class: DocusignDtr::Auth::Base
- Inherits:
-
Object
- Object
- DocusignDtr::Auth::Base
- Includes:
- HTTParty
- Defined in:
- lib/docusign_dtr/auth/base.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#token_response ⇒ Object
Returns the value of attribute token_response.
Instance Method Summary collapse
- #grant_url ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #parse_url_response(url) ⇒ Object
Constructor Details
#initialize ⇒ Base
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
#config ⇒ Object
Returns the value of attribute config.
8 9 10 |
# File 'lib/docusign_dtr/auth/base.rb', line 8 def config @config end |
#token_response ⇒ Object
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_url ⇒ Object
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 |