Class: Mpayer::Account
- Defined in:
- lib/mpayer_ruby/endpoints/account.rb
Instance Attribute Summary collapse
-
#members(page: 1, per_page: 100) ⇒ Object
Mpayer::Account.find(26, fetch:false).members(page:1,per_page:100).
-
#payable_items(page: 1, per_page: 100) ⇒ Object
Mpayer::Account.find(26, fetch:false).payable_items(page:1,per_page:100).
Attributes inherited from Endpoint
#attributes, #config, #endpoint, #id, #pagination, #response
Class Method Summary collapse
-
.aggregates(page: 1, per_page: 100, **options) ⇒ Object
options = dr_cr:nil, ac_type:nil, category:nil Mpayer::Account.aggregate(options).
-
.all(page: 1, per_page: 100) ⇒ Object
Mpayer::Account.all().
-
.find(account_id, fetch: true) ⇒ Object
Mpayer::Account.find(account_id).
Instance Method Summary collapse
- #enroll ⇒ Object
-
#update(options) ⇒ Object
account.update(name:new_name).
Methods inherited from Endpoint
Constructor Details
This class inherits a constructor from Mpayer::Endpoint
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Mpayer::Endpoint
Instance Attribute Details
#members(page: 1, per_page: 100) ⇒ Object
Mpayer::Account.find(26, fetch:false).members(page:1,per_page:100)
41 42 43 |
# File 'lib/mpayer_ruby/endpoints/account.rb', line 41 def members(page:1,per_page:100) find_all(page:page,per_page:per_page) end |
#payable_items(page: 1, per_page: 100) ⇒ Object
Mpayer::Account.find(26, fetch:false).payable_items(page:1,per_page:100)
46 47 48 |
# File 'lib/mpayer_ruby/endpoints/account.rb', line 46 def payable_items(page:1,per_page:100) find_all(page:page,per_page:per_page) end |
Class Method Details
.aggregates(page: 1, per_page: 100, **options) ⇒ Object
options = dr_cr:nil, ac_type:nil, category:nil Mpayer::Account.aggregate(options)
15 16 17 18 |
# File 'lib/mpayer_ruby/endpoints/account.rb', line 15 def aggregates(page:1,per_page:100, **) url = "/accounts/aggregates" Mpayer::Fetch.get(url,query:{page:page,per_page:per_page}.merge!()) end |
.all(page: 1, per_page: 100) ⇒ Object
Mpayer::Account.all()
8 9 10 11 |
# File 'lib/mpayer_ruby/endpoints/account.rb', line 8 def all(page:1,per_page:100) url = "/accounts/all_accounts" Mpayer::Fetch.get(url,query:{page:page,per_page:per_page}) end |
.find(account_id, fetch: true) ⇒ Object
Mpayer::Account.find(account_id)
21 22 23 24 25 |
# File 'lib/mpayer_ruby/endpoints/account.rb', line 21 def find(account_id,fetch:true) url = "/accounts/#{account_id}" response = Mpayer::Fetch.get(url) if fetch account = new(id:account_id,response:response) end |
Instance Method Details
#enroll ⇒ Object
36 37 38 |
# File 'lib/mpayer_ruby/endpoints/account.rb', line 36 def enroll end |