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 +4 -4
- data/lib/unsplash/collection.rb +14 -0
- data/lib/unsplash/connection.rb +1 -2
- data/lib/unsplash/photo.rb +4 -2
- data/lib/unsplash/search.rb +1 -0
- data/lib/unsplash/user.rb +1 -1
- data/lib/unsplash/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 595420e78fad1a215cec6dc35751366feb94f7d8
|
4
|
+
data.tar.gz: 782561f5e238a39f3b179f87ab890b195c4047a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36a82849af0ba7c5fe9be5391c11a34bbf60b28a6b799b31d19914c419eecd1bf726c809b0e240c82af1d7d17e2bb3d1b1c63532dee98a7d1e6381d6a96512b7
|
7
|
+
data.tar.gz: 1bc74aa561b0d6050eb7871729bc31bc818056efcb77910e99118a0dc8122ff26e8bb2d19a51dc652c59641a321985c90ff89039499665d8c293ec6252076cf7
|
data/lib/unsplash/collection.rb
CHANGED
@@ -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)
|
data/lib/unsplash/connection.rb
CHANGED
data/lib/unsplash/photo.rb
CHANGED
@@ -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
|
data/lib/unsplash/search.rb
CHANGED
data/lib/unsplash/user.rb
CHANGED
data/lib/unsplash/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|