Class: AGCOD::GiftCardActivityList
- Inherits:
-
Object
- Object
- AGCOD::GiftCardActivityList
- Extended by:
- Forwardable
- Defined in:
- lib/aws_agcod/gift_card_activity_list.rb
Constant Summary collapse
- LIMIT =
limit per request
1000
- TIME_FORMAT =
'%Y-%m-%dT%H:%M:%SZ'
Instance Method Summary collapse
-
#initialize(httpable, request_id, start_time, end_time, page = 1, per_page = 100, show_no_ops = false) ⇒ GiftCardActivityList
constructor
A new instance of GiftCardActivityList.
- #results ⇒ Object
Constructor Details
#initialize(httpable, request_id, start_time, end_time, page = 1, per_page = 100, show_no_ops = false) ⇒ GiftCardActivityList
Returns a new instance of GiftCardActivityList.
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/aws_agcod/gift_card_activity_list.rb', line 36 def initialize(httpable, request_id, start_time, end_time, page = 1, per_page = 100, show_no_ops = false) raise GiftCardActivityListError, "Only #{LIMIT} records allowed per request." if per_page > LIMIT @response = Request.new(httpable,'GetGiftCardActivityPage', 'requestId' => request_id, 'utcStartDate' => start_time.strftime(TIME_FORMAT), 'utcEndDate' => end_time.strftime(TIME_FORMAT), 'pageIndex' => (page - 1) * per_page, 'pageSize' => per_page, 'showNoOps' => show_no_ops ).response end |
Instance Method Details
#results ⇒ Object
49 50 51 |
# File 'lib/aws_agcod/gift_card_activity_list.rb', line 49 def results @response.payload['cardActivityList'].map { |payload| GiftCardActivity.new(payload) } end |