Sha256: efda8bcfca0ff018000618e42937f80ef657c9db9ea55008200a7a6a05dd1504

Contents?: true

Size: 585 Bytes

Versions: 13

Compression:

Stored size: 585 Bytes

Contents

#!/usr/bin/env ruby -rubygems

require File.join(File.dirname(__FILE__), 'authentication')

collection = StorageRoom::Collection.find('4d960916ba05617333000005')

puts "Nested Loops:\n\n"

# Iterate over all pages of entries with nested loops
collection.entries.each_page do |array|
  puts "== Page: #{array[:@page]} / #{array[:@pages]}"
  array.resources.each do |entry|
    puts "Entry: #{entry.name}"
  end
end

puts "Single helper:\n\n"

# Iterate over all entries on all pages with one helper
collection.entries.each_page_each_resource do |entry|
  puts "Entry: #{entry.name}"
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
storage_room-0.3.24 examples/pagination.rb
storage_room-0.3.23 examples/pagination.rb
storage_room-0.3.22 examples/pagination.rb
storage_room-0.3.21 examples/pagination.rb
storage_room-0.3.20 examples/pagination.rb
storage_room-0.3.19 examples/pagination.rb
storage_room-0.3.18 examples/pagination.rb
storage_room-0.3.17 examples/pagination.rb
storage_room-0.3.16 examples/pagination.rb
storage_room-0.3.15 examples/pagination.rb
storage_room-0.3.14 examples/pagination.rb
storage_room-0.3.13 examples/pagination.rb
storage_room-0.3.12 examples/pagination.rb