Class: Animoto::Postroll

Inherits:
Object
  • Object
show all
Defined in:
lib/animoto/postroll.rb,
lib/animoto/postrolls/custom_footage.rb

Direct Known Subclasses

CustomFootage

Defined Under Namespace

Classes: CustomFootage

Constant Summary collapse

POWERED_BY_ANIMOTO =
new("powered_by_animoto").freeze
WHITE_LABEL =
new("white_label").freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template) ⇒ Animoto::Postroll

Creates a new Postroll with the given template name.

Parameters:

  • template (String)

    the template name



21
22
23
# File 'lib/animoto/postroll.rb', line 21

def initialize template
  @template = template
end

Instance Attribute Details

#templateString (readonly)

The template name for this postroll.

Returns:

  • (String)


15
16
17
# File 'lib/animoto/postroll.rb', line 15

def template
  @template
end

Class Method Details

.new(*args) ⇒ Animoto::Postroll

Constructs a new postroll. If given a Postroll object, returns it. Otherwise, passes the arguments to the constructor for this Postroll class.

Parameters:

  • args (Array<Object>)

    Postroll objects or constructor params

Returns:



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

def self.new *args
  args.first.is_a?(self) ? args.first : super
end

Instance Method Details

#to_hashHash{String=>Object}

Returns a representation of this postroll as a hash.

Returns:

  • (Hash{String=>Object})


27
28
29
# File 'lib/animoto/postroll.rb', line 27

def to_hash
  {'template' => @template}
end