Module: Peddler::Headers
- Included in:
- FlatFileParser, XMLParser
- Defined in:
- lib/peddler/headers.rb
Overview
Parses MWS-specific headers
Instance Method Summary collapse
-
#mws_quota_max ⇒ Integer?
The max hourly request quota for the requested operation.
-
#mws_quota_remaining ⇒ Integer?
The remaining hourly request quota for the requested operation.
-
#mws_quota_resets_on ⇒ Time?
When the hourly request quota for the requested operation resets.
-
#mws_request_id ⇒ String?
The ID of the request.
-
#mws_response_context ⇒ String?
The context of the response.
-
#mws_timestamp ⇒ Time?
The timestamp of the request.
Instance Method Details
#mws_quota_max ⇒ Integer?
The max hourly request quota for the requested operation
8 9 10 11 12 |
# File 'lib/peddler/headers.rb', line 8 def mws_quota_max return unless headers['x-mws-quota-max'] headers['x-mws-quota-max'].to_i end |
#mws_quota_remaining ⇒ Integer?
The remaining hourly request quota for the requested operation
16 17 18 19 20 |
# File 'lib/peddler/headers.rb', line 16 def mws_quota_remaining return unless headers['x-mws-quota-remaining'] headers['x-mws-quota-remaining'].to_i end |
#mws_quota_resets_on ⇒ Time?
When the hourly request quota for the requested operation resets
24 25 26 27 28 |
# File 'lib/peddler/headers.rb', line 24 def mws_quota_resets_on return unless headers['x-mws-quota-resetsOn'] Time.parse(headers['x-mws-quota-resetsOn']) end |
#mws_request_id ⇒ String?
The ID of the request
32 33 34 |
# File 'lib/peddler/headers.rb', line 32 def mws_request_id headers['x-mws-request-id'] end |
#mws_response_context ⇒ String?
The context of the response
46 47 48 |
# File 'lib/peddler/headers.rb', line 46 def mws_response_context headers['x-mws-response-context'] end |
#mws_timestamp ⇒ Time?
The timestamp of the request
38 39 40 41 42 |
# File 'lib/peddler/headers.rb', line 38 def return unless headers['x-mws-timestamp'] Time.parse(headers['x-mws-timestamp']) end |