Class: Animoto::Assets::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/animoto/assets/base.rb

Overview

This class is abstract.

Direct Known Subclasses

Footage, Image, Song

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, options = {}) ⇒ Assets::Base

Creates a new asset.

Parameters:

  • source (String)

    the URL of this asset

  • options (Hash{Symbol=>Object}) (defaults to: {})


16
17
18
# File 'lib/animoto/assets/base.rb', line 16

def initialize source, options = {}
  @source = source
end

Instance Attribute Details

#sourceString

The URL of this asset.

Returns:

  • (String)


9
10
11
# File 'lib/animoto/assets/base.rb', line 9

def source
  @source
end

Instance Method Details

#to_hashHash{String=>Object}

Returns a representation of this asset as a Hash. Used mainly for generating manifests.

Returns:

  • (Hash{String=>Object})

    this asset as a Hash



24
25
26
# File 'lib/animoto/assets/base.rb', line 24

def to_hash
  { 'source_url' => @source, 'type' => self.class.name.split('::').last.underscore }
end