lib/unsplash/collection.rb in unsplash-1.4.0 vs lib/unsplash/collection.rb in unsplash-1.4.1
- old
+ new
@@ -95,11 +95,16 @@
response.status == 204
end
# Get a list of the photos contained in this collection.
# @return [Array] The list of +Unsplash::Photo+s in the collection.
- def photos
- list = JSON.parse(connection.get("/collections/#{id}/photos").body)
+ def photos(page = 1, per_page = 10)
+ params = {
+ page: page,
+ per_page: per_page
+ }
+
+ list = JSON.parse(connection.get("/collections/#{id}/photos", params).body)
list.map { |photo| Unsplash::Photo.new photo }
end
# Add a photo to the collection. If the photo is already in the collection,
# this action has no effect.