class ShutterstockRuby::Videos
A class to hold all videos related code.
Public Class Methods
details(id, options = {})
click to toggle source
# File lib/shutterstock-ruby/videos.rb, line 35 def details(id, options = {}) client.details(id, options) end
purchase(id, subscription_id, size, options = {})
click to toggle source
# File lib/shutterstock-ruby/videos.rb, line 39 def purchase(id, subscription_id, size, options = {}) client.purchase(id, subscription_id, size, options) end
search(query, options = {})
click to toggle source
# File lib/shutterstock-ruby/videos.rb, line 31 def search(query, options = {}) client.search(query, options) end
Public Instance Methods
details(id, options = {})
click to toggle source
# File lib/shutterstock-ruby/videos.rb, line 9 def details(id, options = {}) JSON.parse(get('/videos', { id: id }.merge(options))) end
download(licence)
click to toggle source
# File lib/shutterstock-ruby/videos.rb, line 26 def download(licence) JSON.parse(post("/videos/licenses/#{licence}/downloads", {}.to_json)) end
licenses(video_id, license, options = {})
click to toggle source
# File lib/shutterstock-ruby/videos.rb, line 21 def licenses(video_id, license, options = {}) params = { video_id: video_id, license: license } JSON.parse(get("/videos/licenses", params.merge(options))) end
purchase(id, subscription_id, size, options = {})
click to toggle source
# File lib/shutterstock-ruby/videos.rb, line 13 def purchase(id, subscription_id, size, options = {}) params = { subscription_id: subscription_id, size: size } metadata = options.delete(:metadata) || {} body = { videos: [ { video_id: id }.merge(metadata)] }.to_json JSON.parse(post("/videos/licenses", body, params, options)) end
search(query, options = {})
click to toggle source
# File lib/shutterstock-ruby/videos.rb, line 5 def search(query, options = {}) JSON.parse(get('/videos/search', { query: query }.merge(options))) end