Sha256: 848b10ad1b252e1b6dcf67a49ef645d612d8556a2f8364388ccb55247c6fa3d0

Contents?: true

Size: 1.17 KB

Versions: 8

Compression:

Stored size: 1.17 KB

Contents

module Animoto
  class Video < Animoto::Resource
    
    def self.unpack_standard_envelope body
      super.merge({
        :download_url => body['response']['payload'][payload_key]['links']['file'],
        :storyboard_url => body['response']['payload'][payload_key]['links']['storyboard'],
        :duration => body['response']['payload'][payload_key]['metadata']['duration'],
        :format   => body['response']['payload'][payload_key]['metadata']['format'],
        :framerate  => body['response']['payload'][payload_key]['metadata']['framerate'],
        :resolution => body['response']['payload'][payload_key]['metadata']['vertical_resolution']
      })
    end

    attr_reader :download_url, :storyboard_url, :storyboard, :duration, :format, :framerate, :resolution

    def instantiate attributes = {}
      @download_url = attributes[:download_url]
      @storyboard_url = attributes[:storyboard_url]
      @storyboard = Animoto::Storyboard.new(:url => @storyboard_url) if @storyboard_url
      @duration = attributes[:duration]
      @format = attributes[:format]
      @framerate = attributes[:framerate]
      @resolution = attributes[:resolution]
      super
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
animoto-0.0.0.alpha9 ./lib/animoto/video.rb
animoto-0.0.0.alpha8 ./lib/animoto/video.rb
animoto-0.0.0.alpha7 ./lib/animoto/video.rb
animoto-0.0.0.alpha6 ./lib/animoto/video.rb
animoto-0.0.0.alpha5 ./lib/animoto/video.rb
animoto-0.0.0.alpha4 ./lib/animoto/video.rb
animoto-0.0.0.alpha3 ./lib/animoto/video.rb
animoto-0.0.0.alpha2 ./lib/animoto/video.rb