lib/unsplash/category.rb in unsplash-1.5.5 vs lib/unsplash/category.rb in unsplash-1.5.6
- old
+ new
@@ -5,33 +5,29 @@
class << self
# Get a list of all of the Unsplash photo categories.
# @return [Array] The list categories.
+ # <b>DEPRECATED</b>
def all
- JSON.parse(connection.get("/categories/").body).map do |category|
- new category
- end
+ raise Unsplash::DeprecationError.new "Category has been deprecated and removed."
end
# Get an Unsplash Category.
# @param id [Integer] The ID of the category to retrieve.
# @return [Unsplash::Category] The specified category.
+ # <b>DEPRECATED</b>
def find(id)
- new JSON.parse(connection.get("/categories/#{id}").body)
+ raise Unsplash::DeprecationError.new "Category has been deprecated and removed."
end
end
# Get a list of all photos in this category.
# @param page [Integer] Which page of search results to return.
# @param per_page [Integer] The number of search results per page.
# @return [Array] A single page of +Unsplash::Photo+s.
+ # <b>DEPRECATED</b>
def photos(page = 1, per_page = 10)
- params = {
- page: page,
- per_page: per_page
- }
- list = JSON.parse(connection.get("/categories/#{id}/photos", params).body)
- list.map { |photo| Unsplash::Photo.new photo }
+ raise Unsplash::DeprecationError.new "Category has been deprecated and removed."
end
end
-end
\ No newline at end of file
+end