Class: TelestreamCloud::Video

Inherits:
Resource show all
Includes:
VideoState
Defined in:
lib/telestream_cloud/resources/video.rb

Constant Summary

Constants included from Router

Router::VAR_PATTERN

Instance Attribute Summary

Attributes inherited from Base

#attributes, #errors

Class Method Summary collapse

Instance Method Summary collapse

Methods included from VideoState

#fail?, #processing?, #success?

Methods inherited from Resource

#factory, factory, #initialize, method_missing, #reload

Methods included from FactoryConnection

#connection

Methods included from Associations

included

Methods included from Destroyers

#delete, included

Methods inherited from Base

#changed?, #id, #id=, #initialize, #inspect, #new?, #reload, sti_name, #to_json

Methods included from Finders

included

Methods included from Builders

#create, #create!, included

Methods included from Router

included, #replace_pattern_with_self_variables

Constructor Details

This class inherits a constructor from TelestreamCloud::Resource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class TelestreamCloud::Base

Class Method Details

.firstObject



7
8
9
# File 'lib/telestream_cloud/resources/video.rb', line 7

def first
  VideoScope.new(self).per_page(1).first
end

Instance Method Details

#delete_sourceObject



16
17
18
# File 'lib/telestream_cloud/resources/video.rb', line 16

def delete_source
  connection.delete("/videos/#{id}/source.json")
end

#metadataObject



12
13
14
# File 'lib/telestream_cloud/resources/video.rb', line 12

def 
  connection.get("/videos/#{id}/metadata.json")
end

#preview_url(options = {}) ⇒ Object



20
21
22
23
24
# File 'lib/telestream_cloud/resources/video.rb', line 20

def preview_url(options={})
  default_options = {:https => false}
  options = default_options.merge(options)
  get_url("#{path}_1.jpg", options[:https]) if success?
end

#url(options = {}) ⇒ Object



26
27
28
29
30
# File 'lib/telestream_cloud/resources/video.rb', line 26

def url(options={})
  default_options = {:https => false}
  options = default_options.merge(options)
  get_url("#{path}#{extname}", options[:https]) if success?
end