Class: Postmen::ManifestCollection
- Inherits:
-
Object
- Object
- Postmen::ManifestCollection
- Includes:
- CollectionProxy
- Defined in:
- lib/postmen/manifest_collection.rb
Overview
This class wraps the array of Manifest models
Class Method Summary collapse
-
.all(options = {}) ⇒ Object
Fetch all manifests.
-
.create(params) ⇒ Rate
Creates a Manifest.
-
.find(id) ⇒ Manifest
Fetch single manifest.
Methods included from CollectionProxy
Class Method Details
.all(options = {}) ⇒ Object
Fetch all manifests.
16 17 18 |
# File 'lib/postmen/manifest_collection.rb', line 16 def self.all( = {}) new(Connection.new.get('/manifests', ManifestQuery.new().to_query).parsed_response) end |
.create(params) ⇒ Rate
Creates a Manifest
35 36 37 |
# File 'lib/postmen/manifest_collection.rb', line 35 def self.create(params) Manifest.new(Connection.new.post('/manifests', CreateManifestQuery.new(params).to_query).parsed_response[:data]) end |
.find(id) ⇒ Manifest
Fetch single manifest
26 27 28 |
# File 'lib/postmen/manifest_collection.rb', line 26 def self.find(id) get(Connection.new.get("/manifests/#{id}").parsed_response) end |