Class: Animoto::Resources::Storyboard
- Defined in:
- lib/animoto/resources/storyboard.rb
Instance Attribute Summary collapse
-
#duration ⇒ Float
readonly
The duration (in seconds) that the video, once rendered, will be.
-
#preview_url ⇒ String
readonly
If available, the URL to the low-resolution ‘preview’ video.
-
#visuals_count ⇒ Integer
readonly
The number of visuals (title cards, images, etc.) in this storyboard.
Attributes inherited from Base
Class Method Summary collapse
- .unpack_metadata(body = {}) ⇒ Hash{String=>Object}
- .unpack_standard_envelope(body = {}) ⇒ Hash{Symbol=>Object}
Instance Method Summary collapse
-
#instantiate(attributes = {}) ⇒ Resources::Storyboard
Sets the attributes for a new storyboard.
Methods inherited from Base
endpoint, #endpoint, #initialize, #load, load, new, original_new, register
Methods included from Support::StandardEnvelope
Constructor Details
This class inherits a constructor from Animoto::Resources::Base
Instance Attribute Details
#duration ⇒ Float (readonly)
The duration (in seconds) that the video, once rendered, will be.
25 26 27 |
# File 'lib/animoto/resources/storyboard.rb', line 25 def duration @duration end |
#preview_url ⇒ String (readonly)
If available, the URL to the low-resolution ‘preview’ video.
33 34 35 |
# File 'lib/animoto/resources/storyboard.rb', line 33 def preview_url @preview_url end |
#visuals_count ⇒ Integer (readonly)
The number of visuals (title cards, images, etc.) in this storyboard.
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}
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}
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.
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 |