Class: ShutterstockRuby::Videos
- Inherits:
-
Object
- Object
- ShutterstockRuby::Videos
- Extended by:
- Connections
- Defined in:
- lib/shutterstock-ruby/videos.rb
Overview
A class to hold all videos related code.
Class Method Summary collapse
- .details(id, options = {}) ⇒ Object
- .purchase(id, subscription_id, size, options = {}) ⇒ Object
- .search(query, options = {}) ⇒ Object
Methods included from Connections
Class Method Details
.details(id, options = {}) ⇒ Object
10 11 12 |
# File 'lib/shutterstock-ruby/videos.rb', line 10 def self.details(id, = {}) JSON.parse(self.get('/videos', { id: id }.merge())) end |
.purchase(id, subscription_id, size, options = {}) ⇒ Object
14 15 16 17 18 |
# File 'lib/shutterstock-ruby/videos.rb', line 14 def self.purchase(id, subscription_id, size, = {}) params = { subscription_id: subscription_id, size: size } body = { videos: [ video_id: id ] }.to_json JSON.parse(self.post("/videos/licenses", body, params, )) end |
.search(query, options = {}) ⇒ Object
6 7 8 |
# File 'lib/shutterstock-ruby/videos.rb', line 6 def self.search(query, = {}) JSON.parse(self.get('/videos/search', { query: query }.merge())) end |