class Postmen::ManifestCollection

This class wraps the array of Manifest models

Public Class Methods

all(options = {}) click to toggle source

Fetch all manifests.

@param options [Hash] Options for the query. @see docs.postmen.com/api.html#manifests-list-all-manifests API Documentation @example

.all # Returns all manisfests, default query.
.all(status: :failed) # Returns only failed manifests
# File lib/postmen/manifest_collection.rb, line 16
def self.all(options = {})
  new(Connection.new.get('/manifests', ManifestQuery.new(options).to_query).parsed_response)
end
create(params) click to toggle source

Creates a Manifest

@param params [Hash] Manifest params @see docs.postmen.com/api.html#manifests-create-a-manifest API documentation @return [Rate]

# 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) click to toggle source

Fetch single manifest

@param id [UUID] Manifest UUID @see docs.postmen.com/api.html#manifests-retrieve-a-manifest API documentation @return [Manifest] @raise ResourceNotFound if Manifest with given id was not found

# File lib/postmen/manifest_collection.rb, line 26
def self.find(id)
  get(Connection.new.get("/manifests/#{id}").parsed_response)
end