class Postmen::ManifestQuery

This class holds all the logic behind querying for a single Manifest. @see ManifestCollection.find Usage

Constants

DATE_FORMAT

Expected format for dates example value: 2017-02-08T10:17:04+01:00

Public Instance Methods

to_query() click to toggle source

Converts query object to hash @return [Hash]

# File lib/postmen/query/manifest_query.rb, line 27
def to_query
  {
    params: query
  }
end

Private Instance Methods

format_date(date) click to toggle source
# File lib/postmen/query/manifest_query.rb, line 35
def format_date(date)
  date.fmap { |d| d.strftime(DATE_FORMAT) }.value
end
query() click to toggle source
# File lib/postmen/query/manifest_query.rb, line 39
def query
  {
    shipper_account_id: shipper_account_id,
    status: status,
    limit: limit,
    created_at_min: format_date(created_at_min),
    created_at_max: format_date(created_at_max),
    next_token: next_token
  }.reject { |_k, v| v.nil? }
end