class Authenticator::Client::Base
Public Class Methods
new(config, account)
click to toggle source
Calls superclass method
# File lib/authenticator/client/base.rb, line 14 def initialize(config, account) super( JsonClient::Pather.new(config[:host], 'api/v1', 'accounts'), config ) end
Public Instance Methods
authenticate(account)
click to toggle source
# File lib/authenticator/client/base.rb, line 21 def authenticate(account) request_authentication(account) end
Protected Instance Methods
authenticate_path()
click to toggle source
# File lib/authenticator/client/base.rb, line 38 def authenticate_path "#{pather.host}/api/v1/authentications/authenticate" end
request_authentication(params)
click to toggle source
# File lib/authenticator/client/base.rb, line 27 def request_authentication(params) uri = authenticate_path response = RestClient.post( uri, auth_params.merge(account: params).to_json, content_type: :json, accept: :json ) AuthenticateResponse.new(response) end