class Postmen::RateQuery
This class holds all the logic behind querying for a single Rate
. @see RateCollection.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/rate_query.rb, line 19 def to_query { params: query } end
Private Instance Methods
format_date(date)
click to toggle source
# File lib/postmen/query/rate_query.rb, line 27 def format_date(date) date.fmap { |d| d.strftime(DATE_FORMAT) }.value end
query()
click to toggle source
# File lib/postmen/query/rate_query.rb, line 31 def query { 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