Module: Moneybird::Traits::FindAll
- Included in:
- Service::Administration, Service::Contact, Service::DocumentStyle, Service::Estimate, Service::FinancialAccount, Service::FinancialMutation, Service::Identity, Service::LedgerAccount, Service::Product, Service::PurchaseInvoice, Service::RecurringSalesInvoice, Service::SalesInvoice, Service::TaxRate, Service::Webhook, Service::Workflow
- Defined in:
- lib/moneybird/traits/find_all.rb
Constant Summary collapse
- GET_SUCCESS_CODE =
200
Instance Method Summary collapse
Instance Method Details
#all ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/moneybird/traits/find_all.rb', line 6 def all result = client.get(path) if result.status.to_i == GET_SUCCESS_CODE JSON.parse(result.body).map do |resource| build(resource) end end end |