unsplash 1.4.2 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df1b958c9e2122a59d484cb7feb97c70558404f7
4
- data.tar.gz: 3e869765785ef68d2139ff1d528a8501725d5c8f
3
+ metadata.gz: 595420e78fad1a215cec6dc35751366feb94f7d8
4
+ data.tar.gz: 782561f5e238a39f3b179f87ab890b195c4047a4
5
5
  SHA512:
6
- metadata.gz: 8e9241f01329ec5b656e50cb956e94bebc97ec5de8a9b6876e3687d1f9b59a3af05dd3f31e096172edd713566473e0c33edd5a80dfc84f9b5438868046d751f1
7
- data.tar.gz: 047a0ec4edf001bcb2fed288e075c680dbb3403cf8210e8f725003b2b5c77cbf4457cfadc7bee17d3e2172300f6fb72e126bdecbfa0198dc4745163d944ebc35
6
+ metadata.gz: 36a82849af0ba7c5fe9be5391c11a34bbf60b28a6b799b31d19914c419eecd1bf726c809b0e240c82af1d7d17e2bb3d1b1c63532dee98a7d1e6381d6a96512b7
7
+ data.tar.gz: 1bc74aa561b0d6050eb7871729bc31bc818056efcb77910e99118a0dc8122ff26e8bb2d19a51dc652c59641a321985c90ff89039499665d8c293ec6252076cf7
@@ -26,6 +26,20 @@ module Unsplash # :nodoc:
26
26
  list.map { |data| Unsplash::Collection.new(data) }
27
27
  end
28
28
 
29
+
30
+ # Get a list of all featured collections.
31
+ # @param page [Integer] Which page of results to return.
32
+ # @param per_page [Integer] The number of results per page. (default: 10, maximum: 30)
33
+ # @return [Array] A single page of the +Unsplash::Collection+ list.
34
+ def featured(page = 1, per_page = 10)
35
+ params = {
36
+ page: page,
37
+ per_page: per_page
38
+ }
39
+ list = JSON.parse(connection.get("/collections/featured", params).body)
40
+ list.map { |data| Unsplash::Collection.new(data) }
41
+ end
42
+
29
43
  # Get a list of all curated collections.
30
44
  # @param page [Integer] Which page of search results to return.
31
45
  # @param per_page [Integer] The number of search results per page. (default: 10, maximum: 30)
@@ -123,5 +123,4 @@ module Unsplash #:nodoc:
123
123
  end
124
124
  end
125
125
 
126
-
127
- end
126
+ end
@@ -90,11 +90,13 @@ module Unsplash # :nodoc:
90
90
  # Get a list of all photos.
91
91
  # @param page [Integer] Which page of search results to return.
92
92
  # @param per_page [Integer] The number of search results per page. (default: 10, maximum: 30)
93
+ # @param order_by [String] How to sort the photos.
93
94
  # @return [Array] A single page of +Unsplash::Photo+ search results.
94
- def all(page = 1, per_page = 10)
95
+ def all(page = 1, per_page = 10, order_by = "latest")
95
96
  params = {
96
97
  page: page,
97
- per_page: per_page
98
+ per_page: per_page,
99
+ order_by: order_by
98
100
  }
99
101
  parse_list connection.get("/photos/", params).body
100
102
  end
@@ -2,6 +2,7 @@ module Unsplash # :nodoc:
2
2
 
3
3
  # Unsplash Search operations
4
4
  class Search < Client
5
+
5
6
  class << self
6
7
  # Helper class to facilitate search on multiple classes
7
8
  # @param url [String] Url to be searched into
@@ -1,4 +1,4 @@
1
- module Unsplash # nodoc:
1
+ module Unsplash # :nodoc:
2
2
 
3
3
  # Unsplash User operations.
4
4
  class User < Client
@@ -1,4 +1,4 @@
1
1
  module Unsplash # :nodoc:
2
2
  # :nodoc:
3
- VERSION = "1.4.2"
3
+ VERSION = "1.4.3"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unsplash
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Klaassen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-14 00:00:00.000000000 Z
11
+ date: 2017-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty