Sha256: ff23180e330b9a6724f12c17c26b40a7cac6c691cb0408ff22598dcf914d0974

Contents?: true

Size: 1.49 KB

Versions: 5

Compression:

Stored size: 1.49 KB

Contents

module Animoto
  module Resources
    module Jobs
      class Rendering < Animoto::Resources::Jobs::Base
    
        # @return [Hash{Symbol=>Object}]
        # @see Animoto::Support::StandardEvelope::ClassMethods#unpack_standard_envelope
        def self.unpack_standard_envelope body
          links = unpack_links(body)
          super.merge({
            :storyboard_url => links['storyboard'],
            :video_url      => links['video']
          })
        end
    
        # The Storyboard this job will render a video from.
        # @return [Resources::Storyboard]
        attr_reader :storyboard
        
        # The URL to the storyboard resource.
        # @return [String]
        attr_reader :storyboard_url
        
        # The Video created by this job.
        # @return [Resources::Video]
        attr_reader :video
        
        # The URL to the video resource.
        #
        # @note This URL points to the video *resource* and not the actual video *file*.
        # @return [String]
        attr_reader :video_url
    
        # @return [Jobs::Rendering]
        # @see Animoto::Jobs::Base#instantiate
        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
          super
        end
        
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
animoto-1.3.1 ./lib/animoto/resources/jobs/rendering.rb
animoto-1.3.0 ./lib/animoto/resources/jobs/rendering.rb
animoto-1.2.0 ./lib/animoto/resources/jobs/rendering.rb
animoto-1.1.1 ./lib/animoto/resources/jobs/rendering.rb
animoto-1.1.0 ./lib/animoto/resources/jobs/rendering.rb