Class: Urbanairship::Common::PageIterator
- Inherits:
-
Object
- Object
- Urbanairship::Common::PageIterator
- Includes:
- Enumerable, Urbanairship::Common, Loggable
- Defined in:
- lib/urbanairship/common.rb
Direct Known Subclasses
Devices::APIDList, Devices::ChannelList, Devices::DeviceTokenList, Devices::NamedUserList, Devices::SegmentList, Devices::StaticLists, Push::ScheduledPushList, Reports::AppOpensList, Reports::OptInList, Reports::OptOutList, Reports::PushList, Reports::ResponseList, Reports::ResponseReportList, Reports::TimeInAppList
Constant Summary
Constants included from Urbanairship::Common
Instance Attribute Summary collapse
-
#data_attribute ⇒ Object
Returns the value of attribute data_attribute.
Instance Method Summary collapse
- #count ⇒ Object
- #each ⇒ Object
-
#initialize(client: required('client')) ⇒ PageIterator
constructor
A new instance of PageIterator.
Methods included from Loggable
create_logger, logger, #logger
Methods included from Urbanairship::Common
#apid_path, #channel_path, #compact_helper, #create_and_send_path, #custom_events_path, #device_token_path, #experiments_path, #lists_path, #named_users_path, #open_channel_path, #pipelines_path, #push_path, #reports_path, #required, #schedules_path, #segments_path, #tag_lists_path, #try_helper
Constructor Details
#initialize(client: required('client')) ⇒ PageIterator
Returns a new instance of PageIterator.
160 161 162 163 164 165 166 167 |
# File 'lib/urbanairship/common.rb', line 160 def initialize(client: required('client')) @client = client @count = 0 @data_attribute = nil @data_list = nil @next_page_path = nil @next_page_url = nil end |
Instance Attribute Details
#data_attribute ⇒ Object
Returns the value of attribute data_attribute.
158 159 160 |
# File 'lib/urbanairship/common.rb', line 158 def data_attribute @data_attribute end |
Instance Method Details
#count ⇒ Object
180 181 182 |
# File 'lib/urbanairship/common.rb', line 180 def count @count end |
#each ⇒ Object
169 170 171 172 173 174 175 176 177 178 |
# File 'lib/urbanairship/common.rb', line 169 def each while @next_page_path || @next_page_url load_page @data_list.each do |value| @count += 1 yield value end end end |