Sha256: 9cea129462fc11f7352942adcb92a20529137830d7a4233516b10fef3351db36

Contents?: true

Size: 729 Bytes

Versions: 9

Compression:

Stored size: 729 Bytes

Contents

module Animoto
  module Assets

    # @abstract
    class Base
      
      # The URL of this asset.
      # @return [String]
      attr_accessor :source
      
      # Creates a new asset.
      #
      # @param [String] source the URL of this asset
      # @param [Hash{Symbol=>Object}] options
      # @return [Assets::Base] the asset
      def initialize source, options = {}
        @source = source
      end
    
      # Returns a representation of this asset as a Hash. Used mainly for generating
      # manifests.
      #
      # @return [Hash{String=>Object}] this asset as a Hash
      def to_hash
        { 'source_url' => @source, 'type' => self.class.name.split('::').last.underscore }
      end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
animoto-1.5.6 ./lib/animoto/assets/base.rb
animoto-1.5.5 ./lib/animoto/assets/base.rb
animoto-1.5.4 ./lib/animoto/assets/base.rb
animoto-1.5.3 ./lib/animoto/assets/base.rb
animoto-1.5.2 ./lib/animoto/assets/base.rb
animoto-1.5.1 ./lib/animoto/assets/base.rb
animoto-1.5.0 ./lib/animoto/assets/base.rb
animoto-1.3.1 ./lib/animoto/assets/base.rb
animoto-1.3.0 ./lib/animoto/assets/base.rb