lib/unsplash/collection.rb in unsplash-1.5.6 vs lib/unsplash/collection.rb in unsplash-2.0.0
- old
+ new
@@ -6,13 +6,12 @@
class << self
# Get a specific collection.
# @param id [Integer] The ID of the collection.
# @return [Unsplash::Collection] The requested collection.
- def find(id, curated = false)
- url = ["/collections", (curated ? "curated" : nil), id].compact.join("/")
- Unsplash::Collection.new JSON.parse(connection.get(url).body)
+ def find(id)
+ Unsplash::Collection.new JSON.parse(connection.get("/collections/#{id}").body)
end
# Get a list of all collections.
# @param page [Integer] Which page of search results to return.
# @param per_page [Integer] The number of search results per page. (default: 10, maximum: 30)
@@ -35,22 +34,9 @@
params = {
page: page,
per_page: per_page
}
list = JSON.parse(connection.get("/collections/featured", params).body)
- list.map { |data| Unsplash::Collection.new(data) }
- end
-
- # Get a list of all curated collections.
- # @param page [Integer] Which page of search results to return.
- # @param per_page [Integer] The number of search results per page. (default: 10, maximum: 30)
- # @return [Array] A single page of the +Unsplash::Collection+ list.
- def curated(page = 1, per_page = 10)
- params = {
- page: page,
- per_page: per_page
- }
- list = JSON.parse(connection.get("/collections/curated", params).body)
list.map { |data| Unsplash::Collection.new(data) }
end
# Create a new collection on behalf of current user.
# @param title [String] The title of the collection.