Module: Invoicexpress::Client::Users
- Included in:
- Invoicexpress::Client
- Defined in:
- lib/invoicexpress/client/users.rb
Instance Method Summary collapse
-
#accounts(options = {}) ⇒ Array<Invoicexpress::Models::Account>
This method allows you to view your accounts.
-
#change_account(account_id, options = {}) ⇒ Object
Changes the current account to the account id submitte.
-
#login(login, password, options = {}) ⇒ Array<Invoicexpress::Models::Account>
This endpoint does not require an API KEY to be acessible.
Instance Method Details
#accounts(options = {}) ⇒ Array<Invoicexpress::Models::Account>
This method allows you to view your accounts.
27 28 29 30 |
# File 'lib/invoicexpress/client/users.rb', line 27 def accounts( = {}) params = { :klass => Invoicexpress::Models::Account } get("users/accounts.xml", params.merge()) end |
#change_account(account_id, options = {}) ⇒ Object
Changes the current account to the account id submitte
37 38 39 40 41 42 43 44 |
# File 'lib/invoicexpress/client/users.rb', line 37 def change_account(account_id, ={}) change_account_to = Invoicexpress::Models::ChangeAccountTo.new( :id => account_id ) params = { :klass => Invoicexpress::Models::Account, :body => change_account_to } put("users/change-account.xml", params.merge()) end |
#login(login, password, options = {}) ⇒ Array<Invoicexpress::Models::Account>
This endpoint does not require an API KEY to be acessible. Instead it requires your current login and password. Upon successful login it will return all the accounts which belong to you
13 14 15 16 17 18 19 20 21 |
# File 'lib/invoicexpress/client/users.rb', line 13 def login(login, password, ={}) credentials = Invoicexpress::Models::Credentials.new( :login => login, :password => password ) params = { :klass => Invoicexpress::Models::Account, :body => credentials } post("login.xml", params.merge()) end |