Class: RestfulKashflow::Client
- Inherits:
-
Object
- Object
- RestfulKashflow::Client
- Defined in:
- lib/restful_kashflow/client.rb
Overview
A class for working with and talking to the Kashflow API
Instance Method Summary collapse
- #customer(customer_id = nil) ⇒ Object
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
- #status ⇒ Object
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/restful_kashflow/client.rb', line 5 def initialize() username = .delete(:username) || raise('No username given to Restful Kashflow Client') password = .delete(:password) || raise('No password given to Restful Kashflow Client') memorable_word = .delete(:memorable_word) || raise('No memorable word given to Restful Kashflow Client') environment = .delete(:environment) || :live @customer = {} url = .delete(:url) || url_for_environment(environment) @api_service = ApiService.new(username, password, memorable_word, url, ) end |
Instance Method Details
#customer(customer_id = nil) ⇒ Object
25 26 27 |
# File 'lib/restful_kashflow/client.rb', line 25 def customer(customer_id = nil) @customer[customer_id] ||= Services::Customer.new(@api_service, customer_id) end |
#status ⇒ Object
21 22 23 |
# File 'lib/restful_kashflow/client.rb', line 21 def status @api_service.status end |