Class: Animoto::Assets::Image
Instance Attribute Summary collapse
-
#caption ⇒ String
Whether or not this image has a caption.
-
#cover ⇒ Boolean
writeonly
Whether or not this image is the cover of the video.
-
#rotation ⇒ Integer
The number of clockwise 90-degree rotations that should be applied to this image.
-
#spotlit ⇒ Boolean
writeonly
Whether or not this image is spotlit.
Attributes inherited from Base
Instance Method Summary collapse
-
#cover? ⇒ Boolean
Returns whether or not this footage is marked as the cover.
-
#initialize(source, options = {}) ⇒ Assets::Image
constructor
Creates a new Image object.
-
#spotlit? ⇒ Boolean
Returns whether or not this image is spotlit.
-
#to_hash ⇒ Hash{String=>Object}
Returns a representation of this Image as a Hash.
Constructor Details
#initialize(source, options = {}) ⇒ Assets::Image
Creates a new Image object.
44 45 46 47 48 49 50 |
# File 'lib/animoto/assets/image.rb', line 44 def initialize source, = {} super @rotation = [:rotation] @spotlit = [:spotlit] @cover = [:cover] @caption = [:caption] end |
Instance Attribute Details
#caption ⇒ String
Whether or not this image has a caption. If a caption is added, it will appear with the image in the video.
33 34 35 |
# File 'lib/animoto/assets/image.rb', line 33 def @caption end |
#cover=(value) ⇒ Boolean (writeonly)
Whether or not this image is the cover of the video. If this image is the video’s cover, the cover image will be generated using this image.
22 23 24 |
# File 'lib/animoto/assets/image.rb', line 22 def cover=(value) @cover = value end |
#rotation ⇒ Integer
The number of clockwise 90-degree rotations that should be applied to this image.
6 7 8 |
# File 'lib/animoto/assets/image.rb', line 6 def rotation @rotation end |
#spotlit=(value) ⇒ Boolean (writeonly)
Whether or not this image is spotlit. Spotlighting a visual tells to director to add more emphasis to this visual when directing.
11 12 13 |
# File 'lib/animoto/assets/image.rb', line 11 def spotlit=(value) @spotlit = value end |
Instance Method Details
#cover? ⇒ Boolean
Returns whether or not this footage is marked as the cover.
26 27 28 |
# File 'lib/animoto/assets/image.rb', line 26 def cover? @cover end |
#spotlit? ⇒ Boolean
Returns whether or not this image is spotlit.
15 16 17 |
# File 'lib/animoto/assets/image.rb', line 15 def spotlit? @spotlit end |
#to_hash ⇒ Hash{String=>Object}
Returns a representation of this Image as a Hash.
56 57 58 59 60 61 62 63 |
# File 'lib/animoto/assets/image.rb', line 56 def to_hash hash = super hash['rotation'] = rotation if rotation hash['spotlit'] = spotlit? unless @spotlit.nil? hash['cover'] = cover? unless @cover.nil? hash['caption'] = unless @caption.nil? hash end |