lib/unsplash/user.rb in unsplash-1.4.1 vs lib/unsplash/user.rb in unsplash-1.4.2
- old
+ new
@@ -26,15 +26,17 @@
end
# Get a single page of user results for a query.
# @param query [String] Keywords to search for.
# @param page [Integer] Which page of search results to return.
+ # @param per_page [Integer] The number of users search result per page. (default: 10, maximum: 30)
# @return [Array] a list of +Unsplash::User+ objects.
- def search(query, page = 1)
+ def search(query, page = 1, per_page = 10)
params = {
query: query,
- page: page
+ page: page,
+ per_page: per_page
}
Unsplash::Search.search("/search/users", self, params)
end
end
@@ -55,11 +57,11 @@
end
end
# Get a list of photos liked by the user.
# @param page [Integer] Which page of results to return.
- # @param per_page [Integer] The number of results per page.
+ # @param per_page [Integer] The number of results per page. (default: 10, maximum: 30)
# @return [Array] a list of +Unsplash::Photo+ objects.
def likes(page = 1, per_page = 10)
params = {
page: page,
per_page: per_page
@@ -71,11 +73,11 @@
end
end
# Get a list of collections created by the user.
# @param page [Integer] Which page of results to return.
- # @param per_page [Integer] The number of results per page.
+ # @param per_page [Integer] The number of results per page. (default: 10, maximum: 30)
# @return [Array] a list of +Unsplash::Collection+ objects.
def collections(page = 1, per_page = 10)
params = {
page: page,
per_page: per_page
@@ -86,7 +88,6 @@
Unsplash::Collection.new collection.to_hash
end
end
end
-
end