Class: AbsorbApi::Authorize
- Inherits:
-
Object
- Object
- AbsorbApi::Authorize
- Defined in:
- lib/absorb_api/authorize.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize ⇒ Authorize
constructor
A new instance of Authorize.
Constructor Details
#initialize ⇒ Authorize
Returns a new instance of Authorize.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/absorb_api/authorize.rb', line 5 def initialize @token ||= Faraday.new(url: AbsorbApi.configuration.url) do |faraday| faraday.request :url_encoded faraday.response :logger faraday.adapter :typhoeus end.post do |req| req.url 'Authenticate', username: AbsorbApi.configuration.absorbuser, password: AbsorbApi.configuration.absorbpass, privateKey: AbsorbApi.configuration.absorbkey req.headers['Content-Type'] = 'application/json' req.headers['accept'] = 'json' end.body.delete('\\"') end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
3 4 5 |
# File 'lib/absorb_api/authorize.rb', line 3 def token @token end |