Class: Animoto::Resources::Jobs::Rendering

Inherits:
Base
  • Object
show all
Defined in:
lib/animoto/resources/jobs/rendering.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#errors, #state, #url

Attributes inherited from Base

#errors, #url

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#completed?, endpoint, #failed?, infer_content_type, infer_endpoint, #pending?

Methods inherited from Base

endpoint, #endpoint, #initialize, #load, load, new, original_new, register

Methods included from Support::StandardEnvelope

find_class_for, included

Constructor Details

This class inherits a constructor from Animoto::Resources::Base

Instance Attribute Details

#storyboardResources::Storyboard (readonly)

The Storyboard this job will render a video from.



19
20
21
# File 'lib/animoto/resources/jobs/rendering.rb', line 19

def storyboard
  @storyboard
end

#storyboard_urlString (readonly)

The URL to the storyboard resource.

Returns:

  • (String)


23
24
25
# File 'lib/animoto/resources/jobs/rendering.rb', line 23

def storyboard_url
  @storyboard_url
end

#stream_urlString (readonly)

Note:

this attribute may not be available when the job is first created. If you poll the job while it’s rendering, the URL will appear when the stream is available to view.

If available, the URL where the video can be watched ‘live’ via HTTP Live Streaming.

Returns:

  • (String)


40
41
42
# File 'lib/animoto/resources/jobs/rendering.rb', line 40

def stream_url
  @stream_url
end

#videoResources::Video (readonly)

The Video created by this job.

Returns:



27
28
29
# File 'lib/animoto/resources/jobs/rendering.rb', line 27

def video
  @video
end

#video_urlString (readonly)

Note:

This URL points to the video resource and not the actual video file.

The URL to the video resource.

Returns:

  • (String)


33
34
35
# File 'lib/animoto/resources/jobs/rendering.rb', line 33

def video_url
  @video_url
end

Class Method Details

.unpack_standard_envelope(body) ⇒ Hash{Symbol=>Object}

Returns:

  • (Hash{Symbol=>Object})

See Also:

  • Support::StandardEvelope::ClassMethods#unpack_standard_envelope


8
9
10
11
12
13
14
15
# File 'lib/animoto/resources/jobs/rendering.rb', line 8

def self.unpack_standard_envelope body
  links = unpack_links(body)
  super.merge({
    :storyboard_url => links['storyboard'],
    :video_url      => links['video'],
    :stream_url     => links['stream']
  })
end

Instance Method Details

#instantiate(attributes = {}) ⇒ Jobs::Rendering

Returns:

See Also:

  • Jobs::Base#instantiate


44
45
46
47
48
49
50
51
# File 'lib/animoto/resources/jobs/rendering.rb', line 44

def instantiate attributes = {}
  @storyboard_url = attributes[:storyboard_url]
  @storyboard = Animoto::Resources::Storyboard.new(:url => @storyboard_url) if @storyboard_url
  @video_url = attributes[:video_url]
  @video = Animoto::Resources::Video.new(:url => @video_url) if @video_url
  @stream_url = attributes[:stream_url]
  super
end