Class: Animoto::Resources::Storyboard

Inherits:
Base
  • Object
show all
Defined in:
lib/animoto/resources/storyboard.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#errors, #url

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

endpoint, #endpoint, #initialize, #load, load, new, original_new, register

Methods included from Support::StandardEnvelope

find_class_for, included

Constructor Details

This class inherits a constructor from Animoto::Resources::Base

Instance Attribute Details

#durationFloat (readonly)

The duration (in seconds) that the video, once rendered, will be.

Returns:

  • (Float)


25
26
27
# File 'lib/animoto/resources/storyboard.rb', line 25

def duration
  @duration
end

#preview_urlString (readonly)

If available, the URL to the low-resolution ‘preview’ video.

Returns:

  • (String)


33
34
35
# File 'lib/animoto/resources/storyboard.rb', line 33

def preview_url
  @preview_url
end

#visuals_countInteger (readonly)

The number of visuals (title cards, images, etc.) in this storyboard.

Returns:

  • (Integer)


29
30
31
# File 'lib/animoto/resources/storyboard.rb', line 29

def visuals_count
  @visuals_count
end

Class Method Details

.unpack_metadata(body = {}) ⇒ Hash{String=>Object}

Returns:

  • (Hash{String=>Object})

See Also:

  • Support::Support::ClassMethods#unpack_standard_envelope


8
9
10
# File 'lib/animoto/resources/storyboard.rb', line 8

def self. body = {}
  unpack_payload(body)['metadata'] || {}
end

.unpack_standard_envelope(body = {}) ⇒ Hash{Symbol=>Object}

Returns:

  • (Hash{Symbol=>Object})

See Also:

  • Support::StandardEnvelope::ClassMethods#unpack_standard_envelope


14
15
16
17
18
19
20
21
# File 'lib/animoto/resources/storyboard.rb', line 14

def self.unpack_standard_envelope body = {}
   = (body)
  super.merge({
    :duration       => ['duration'],
    :visuals_count  => ['visuals_count'],
    :preview_url    => unpack_links(body)['preview']
  })
end

Instance Method Details

#instantiate(attributes = {}) ⇒ Resources::Storyboard

Sets the attributes for a new storyboard.

Parameters:

  • attributes (Hash) (defaults to: {})

Options Hash (attributes):

  • :duration (Integer)

    the duration (in seconds) the rendered video will be

  • :visuals_count (Integer)

    the number of visuals the rendered video will have

  • :preview_url (String)

    URL to a low-resolution preview of the rendered video

Returns:

See Also:



43
44
45
46
47
48
# File 'lib/animoto/resources/storyboard.rb', line 43

def instantiate attributes = {}
  @duration = attributes[:duration]
  @visuals_count = attributes[:visuals_count]
  @preview_url = attributes[:preview_url]
  super
end