Class: QuickPay::API::Client
- Inherits:
-
Object
- Object
- QuickPay::API::Client
- Defined in:
- lib/quickpay/api/client.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #extract_auth(params) ⇒ Object
-
#initialize(auth_params = {}, opts = {}) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(auth_params = {}, opts = {}) ⇒ Client
Returns a new instance of Client.
14 15 16 17 18 19 |
# File 'lib/quickpay/api/client.rb', line 14 def initialize(auth_params = {}, opts = {}) opts[:secret] ||= extract_auth(auth_params) opts[:base_uri] ||= (QuickPay.base_uri || QuickPay::BASE_URI) @options = opts.dup end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
12 13 14 |
# File 'lib/quickpay/api/client.rb', line 12 def @options end |
Instance Method Details
#extract_auth(params) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/quickpay/api/client.rb', line 21 def extract_auth params if params[:email] and params[:password] "#{params[:email]}:#{params[:password]}" elsif params[:api_key] ":#{params[:api_key]}" end end |