Class: Postmen::ShipperAccountCollection
- Inherits:
-
Object
- Object
- Postmen::ShipperAccountCollection
- Includes:
- CollectionProxy
- Defined in:
- lib/postmen/shipper_account_collection.rb
Overview
This class wraps the array of ShipperAccount models
Class Method Summary collapse
-
.all(options = {}) ⇒ Object
Fetch all shipper accounts.
-
.create(params) ⇒ ShipperAccount
Creates a ShipperAccount.
-
.find(id) ⇒ ShipperAccount
Fetch single ShipperAccount.
Methods included from CollectionProxy
Class Method Details
.all(options = {}) ⇒ Object
Fetch all shipper accounts.
16 17 18 |
# File 'lib/postmen/shipper_account_collection.rb', line 16 def self.all( = {}) new(Connection.new.get('/shipper-accounts', ShipperAccountQuery.new().to_query).parsed_response) end |
.create(params) ⇒ ShipperAccount
Creates a ShipperAccount
35 36 37 38 39 40 41 42 |
# File 'lib/postmen/shipper_account_collection.rb', line 35 def self.create(params) ShipperAccount.new( Connection.new.post( '/shipper-accounts', CreateShipperAccountQuery.new(params).to_query ).parsed_response[:data] ) end |
.find(id) ⇒ ShipperAccount
Fetch single ShipperAccount
26 27 28 |
# File 'lib/postmen/shipper_account_collection.rb', line 26 def self.find(id) get(Connection.new.get("/shipper-accounts/#{id}").parsed_response) end |