Class: Authenticator::Client::Base
- Inherits:
-
JsonClient::Base
- Object
- JsonClient::Base
- Authenticator::Client::Base
- Defined in:
- lib/authenticator/client/base.rb
Instance Method Summary collapse
- #authenticate(account) ⇒ Object
-
#initialize(config) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(config) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 |
# File 'lib/authenticator/client/base.rb', line 8 def initialize(config) super( JsonClient::Pather.new(config[:host], 'api/v1', 'accounts'), config ) end |
Instance Method Details
#authenticate(account) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/authenticator/client/base.rb', line 15 def authenticate(account) uri = authenticate_path response = RestClient.post( uri, auth_params.merge(account.to_h).to_json, content_type: :json, accept: :json ) AuthenticateResponse.new(response.body, response.code) end |