Class: Sorenson::Services::Preset

Inherits:
Base show all
Defined in:
lib/sorenson/services/preset.rb

Overview

Allows you to access the resources associated with a sorenson services asset. An asset currently refers to video content.

Class Method Summary collapse

Methods inherited from Base

delete_from, get_from, host, login_no_resource, parse_response, post_to, put_to, verify_account_settings

Class Method Details

.allObject



7
8
9
# File 'lib/sorenson/services/preset.rb', line 7

def self.all
  get_from('/presets')
end

.create(name, group_id, file) ⇒ Object



20
21
22
# File 'lib/sorenson/services/preset.rb', line 20

def self.create(name, group_id, file)
  post_to("/presets", :file_name => name, :group_guid => group_id, :file => file)
end

.find_by_name(name) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/sorenson/services/preset.rb', line 11

def self.find_by_name(name)
  response = get_from("/presets/#{URI.encode(name)}")
  if response.has_key?(:errors)
    nil
  else
    response['url']
  end
end