Module: Highrise::Pagination::ClassMethods
- Defined in:
- lib/highrise/pagination.rb
Instance Method Summary collapse
Instance Method Details
#each(options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/highrise/pagination.rb', line 14 def each( = {}) [:params] ||= {} [:params][:n] = 0 loop do if (records = self.find(:all, )).any? records.each { |record| yield record } [:params][:n] += records.size else break # no people included on that page, thus no more people total end end end |
#find_all_across_pages(options = {}) ⇒ Object
8 9 10 11 12 |
# File 'lib/highrise/pagination.rb', line 8 def find_all_across_pages( = {}) records = [] each() { |record| records << record } records end |