unsplash 3.0.0 → 3.1.1
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/photo.rb +8 -4
- data/lib/unsplash/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8761235452718ff837fb8b5300c01cbbcbb0773f0ce6a35d71a2a78f4db49a1
|
4
|
+
data.tar.gz: f53460d0b82916d1310ead53f989d1dcbd457caee4e846a7c27377abc55bb256
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: facc37b4ff1c8773d8e52a3fcbcbfb8a2900ad7bd5f23a29af0b66a91b604b2b7423e75a1bff190c7aabfe7e40c6e29ac60e3ad01ca0adb5f7c678c25496c577
|
7
|
+
data.tar.gz: a711ae14751a9d360760974b1fac6a116a4a20170fe66526a10c3fd31bf21f927904e89a432914df51ef33e69195f79ec6b8efc8e671d7166cc23c4b98b04ca7
|
data/lib/unsplash/photo.rb
CHANGED
@@ -52,9 +52,10 @@ module Unsplash # :nodoc:
|
|
52
52
|
# @param user [String] Limit selection to given User's ID.
|
53
53
|
# @param query [String] Limit selection to given search query.
|
54
54
|
# @param orientation [String] Filter by orientation of the photo. Valid values are landscape, portrait, and squarish.
|
55
|
+
# @param content_filter [String] Limit results by content_filter to avoid content that may be unsuitable for younger audiences. Valid values are low, high. Defaults to low.
|
55
56
|
# @return [Unsplash::Photo] An Unsplash Photo if count parameter is omitted
|
56
57
|
# @return [Array] An array of Unsplash Photos if the count parameter is specified. An array is returned even if count is 1
|
57
|
-
def random(count: nil, collections: nil, featured: nil, user: nil, query: nil, orientation: nil)
|
58
|
+
def random(count: nil, collections: nil, featured: nil, user: nil, query: nil, orientation: nil, content_filter: "low")
|
58
59
|
Unsplash.configuration.logger.warn "You cannot combine 'collections' and 'query' parameters. 'query' will be ignored." if collections && query
|
59
60
|
|
60
61
|
params = {
|
@@ -62,7 +63,8 @@ module Unsplash # :nodoc:
|
|
62
63
|
featured: featured,
|
63
64
|
username: user,
|
64
65
|
query: query,
|
65
|
-
orientation: orientation
|
66
|
+
orientation: orientation,
|
67
|
+
content_filter: content_filter
|
66
68
|
}.select { |k,v| v }
|
67
69
|
if count
|
68
70
|
params[:count] = count
|
@@ -83,13 +85,15 @@ module Unsplash # :nodoc:
|
|
83
85
|
# @param page [Integer] Which page of search results to return.
|
84
86
|
# @param per_page [Integer] The number of users search result per page. (default: 10, maximum: 30)
|
85
87
|
# @param orientation [String] Filter by orientation of the photo. Valid values are landscape, portrait, and squarish.
|
88
|
+
# @param content_filter [String] Limit results by content_filter to avoid content that may be unsuitable for younger audiences. Valid values are low, high. Defaults to low.
|
86
89
|
# @return [SearchResult] a list of +Unsplash::Photo+ objects.
|
87
|
-
def search(query, page = 1, per_page = 10, orientation = nil)
|
90
|
+
def search(query, page = 1, per_page = 10, orientation = nil, content_filter = "low")
|
88
91
|
params = {
|
89
92
|
query: query,
|
90
93
|
page: page,
|
91
94
|
per_page: per_page,
|
92
|
-
orientation: orientation
|
95
|
+
orientation: orientation,
|
96
|
+
content_filter: content_filter
|
93
97
|
}.select { |_k, v| v }
|
94
98
|
Unsplash::Search.search("/search/photos", self, params)
|
95
99
|
end
|
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: 3.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Klaassen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|