flickr-objects 0.5.3 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flickr/api.rb +8 -1
- data/lib/flickr/api/abstract.rb +1 -1
- data/lib/flickr/api/license.rb +19 -0
- data/lib/flickr/api/photo.rb +9 -0
- data/lib/flickr/object.rb +1 -1
- data/lib/flickr/object/license.rb +13 -0
- data/lib/flickr/object/photo.rb +8 -0
- data/lib/flickr/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da97710af16b03fe15e23c1bd8c523db79b26b85
|
4
|
+
data.tar.gz: 65ee1ec70dacbda2850ba99d10247d8b681f4880
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8375724b89bbd0aa84bde3355309e773e40497eebc0a3030dd65d8d5c2e2684a8e6212333c1633455002c9620d02b91e7d93814d6d5cf524c7e46e2b84f45f9c
|
7
|
+
data.tar.gz: 40fa5a43230f9f4f0ad3d0ac1c24d69f2269a4afdd0141129d68facde2e4c729f4f6fded406f8fb832054ef6c257535528b852a0a0925f6d1900a5ea95995687
|
data/lib/flickr/api.rb
CHANGED
@@ -5,7 +5,7 @@ module Flickr
|
|
5
5
|
extend Flickr::AutoloadHelper
|
6
6
|
|
7
7
|
autoload_names \
|
8
|
-
:Abstract, :General, :Photo, :Person, :Set, :UploadTicket
|
8
|
+
:Abstract, :General, :Photo, :Person, :Set, :UploadTicket, :License
|
9
9
|
|
10
10
|
##
|
11
11
|
# @return [Flickr::Api::Photo]
|
@@ -35,6 +35,13 @@ module Flickr
|
|
35
35
|
Flickr::Api::UploadTicket.new(access_token)
|
36
36
|
end
|
37
37
|
|
38
|
+
##
|
39
|
+
# @return [Flickr::Api::License]
|
40
|
+
#
|
41
|
+
def licenses
|
42
|
+
Flickr::Api::License.new(access_token)
|
43
|
+
end
|
44
|
+
|
38
45
|
##
|
39
46
|
# @return [String]
|
40
47
|
# @see Flickr::Api::General#upload
|
data/lib/flickr/api/abstract.rb
CHANGED
@@ -103,7 +103,7 @@ module Flickr
|
|
103
103
|
# # [#<Flickr::Object::Photo:0x007ffe6b4ff760 owner=#<Flickr::Object::Person:0x007ffe6b52d408 >>,
|
104
104
|
# # #<Flickr::Object::Photo:0x007ffe6b4fdcd0 owner=#<Flickr::Object::Person:0x007ffe6b556ab0 >>]>
|
105
105
|
#
|
106
|
-
def new_list(class_name, attributes_list, list_attributes)
|
106
|
+
def new_list(class_name, attributes_list, list_attributes = {})
|
107
107
|
objects = attributes_list.map { |attributes| new_object(class_name, attributes) }
|
108
108
|
list = Flickr::Object::List.new(list_attributes)
|
109
109
|
list.populate(objects)
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Flickr
|
2
|
+
module Api
|
3
|
+
|
4
|
+
class License < Abstract
|
5
|
+
|
6
|
+
##
|
7
|
+
# @param params [Hash] See documentation below
|
8
|
+
# @return [Flickr::Object::List<Flickr::Object::License>]
|
9
|
+
# @docs [flickr.photos.licenses.getInfo](https://www.flickr.com/services/api/flickr.photos.licenses.getInfo.html)
|
10
|
+
#
|
11
|
+
def all(params = {})
|
12
|
+
response = get "photos.licenses.getInfo", params
|
13
|
+
new_list(:License, response["licenses"].delete("license"))
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
data/lib/flickr/api/photo.rb
CHANGED
@@ -240,6 +240,15 @@ module Flickr
|
|
240
240
|
post "photos.setSafetyLevel", params.merge(photo_id: photo_id)
|
241
241
|
end
|
242
242
|
|
243
|
+
##
|
244
|
+
# @param params [Hash] See documentation below
|
245
|
+
# @return [response]
|
246
|
+
# @docs [flickr.photos.licenses.setLicense](https://www.flickr.com/services/api/flickr.photos.licenses.setLicense.html)
|
247
|
+
#
|
248
|
+
def set_license(photo_id, license_id, params = {})
|
249
|
+
post "photos.licenses.setLicense", params.merge(photo_id: photo_id, license_id: license_id)
|
250
|
+
end
|
251
|
+
|
243
252
|
end
|
244
253
|
|
245
254
|
end
|
data/lib/flickr/object.rb
CHANGED
data/lib/flickr/object/photo.rb
CHANGED
@@ -322,6 +322,14 @@ module Flickr
|
|
322
322
|
api.set_safety_level(id, params)
|
323
323
|
end
|
324
324
|
|
325
|
+
##
|
326
|
+
# @return [response]
|
327
|
+
# @see Flickr::Api::Photo#set_license
|
328
|
+
#
|
329
|
+
def set_license(license_id, params = {})
|
330
|
+
api.set_license(id, license_id, params)
|
331
|
+
end
|
332
|
+
|
325
333
|
private
|
326
334
|
|
327
335
|
##
|
data/lib/flickr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flickr-objects
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janko Marohnić
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -193,6 +193,7 @@ files:
|
|
193
193
|
- lib/flickr/api/abstract.rb
|
194
194
|
- lib/flickr/api/abstract/params_processor.rb
|
195
195
|
- lib/flickr/api/general.rb
|
196
|
+
- lib/flickr/api/license.rb
|
196
197
|
- lib/flickr/api/person.rb
|
197
198
|
- lib/flickr/api/photo.rb
|
198
199
|
- lib/flickr/api/set.rb
|
@@ -220,6 +221,7 @@ files:
|
|
220
221
|
- lib/flickr/object/attribute_locations/set.rb
|
221
222
|
- lib/flickr/object/attribute_locations/upload_ticket.rb
|
222
223
|
- lib/flickr/object/attribute_locations/visibility.rb
|
224
|
+
- lib/flickr/object/license.rb
|
223
225
|
- lib/flickr/object/list.rb
|
224
226
|
- lib/flickr/object/list/kaminari.rb
|
225
227
|
- lib/flickr/object/list/normal.rb
|