lib/unsplash/photo.rb in unsplash-1.5.4 vs lib/unsplash/photo.rb in unsplash-1.5.5
- old
+ new
@@ -89,18 +89,18 @@
params = {
query: query,
page: page,
per_page: per_page,
orientation: orientation
- }
+ }.select { |_k, v| v }
Unsplash::Search.search("/search/photos", self, params)
end
# Get a list of all photos.
# @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)
- # @param order_by [String] How to sort the photos.
+ # @param order_by [String] How to sort the photos. (Valid values: latest, oldest, popular; default: latest)
# @return [Array] A single page of +Unsplash::Photo+ search results.
def all(page = 1, per_page = 10, order_by = "latest")
params = {
page: page,
per_page: per_page,
@@ -110,12 +110,12 @@
end
# Get a single page from the list of the curated photos (front-page’s photos).
# @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)
- # @param order_by [String] How to sort the photos.
+ # @param order_by [String] How to sort the photos. (Valid values: latest, oldest, popular; default: latest)
# @return [Array] A single page of +Unsplash::Photo+ search results.
- def curated(page = 1, per_page = 10, order_by = "popular")
+ def curated(page = 1, per_page = 10, order_by = "latest")
params = {
page: page,
per_page: per_page,
order_by: order_by
}