Class: ShutterstockRuby::Videos

Inherits:
Object
  • Object
show all
Extended by:
Connections
Defined in:
lib/shutterstock-ruby/videos.rb

Overview

A class to hold all videos related code.

Class Method Summary collapse

Methods included from Connections

get, post

Class Method Details

.details(id, options = {}) ⇒ Object



10
11
12
# File 'lib/shutterstock-ruby/videos.rb', line 10

def self.details(id, options = {})
  JSON.parse(self.get('/videos', { id: id }.merge(options)))
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, options = {})
  params = { subscription_id: subscription_id, size: size }
  body = { videos: [ video_id: id ] }.to_json
  JSON.parse(self.post("/videos/licenses", body, params, options))
end

.search(query, options = {}) ⇒ Object



6
7
8
# File 'lib/shutterstock-ruby/videos.rb', line 6

def self.search(query, options = {})
  JSON.parse(self.get('/videos/search', { query: query }.merge(options)))
end