Class: Animoto::Assets::TitleCard

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, subtitle = nil, options = {}) ⇒ Assets::TitleCard

Creates a new TitleCard.

Parameters:

  • title (String)

    the main text

  • subtitle (String) (defaults to: nil)

    the secondary text

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

Options Hash (options):

  • :spotlit (Boolean)

    whether or not to spotlight this title card



30
31
32
33
# File 'lib/animoto/assets/title_card.rb', line 30

def initialize title, subtitle = nil, options = {}
  @title, @subtitle = title, subtitle
  @spotlit = options[:spotlit]
end

Instance Attribute Details

#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.

Returns:

  • (Boolean)


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

def spotlit=(value)
  @spotlit = value
end

#subtitleString

The secondary text of this title card.

Returns:

  • (String)


10
11
12
# File 'lib/animoto/assets/title_card.rb', line 10

def subtitle
  @subtitle
end

#titleString

The main text of this title card.

Returns:

  • (String)


6
7
8
# File 'lib/animoto/assets/title_card.rb', line 6

def title
  @title
end

Instance Method Details

#spotlit?Boolean

Returns whether or not this image is spotlit.

Returns:

  • (Boolean)


19
20
21
# File 'lib/animoto/assets/title_card.rb', line 19

def spotlit?
  @spotlit
end

#to_hashHash{String=>Object}

Returns a representation of this TitleCard as a Hash.

Returns:

  • (Hash{String=>Object})

    this TitleCard as a Hash



38
39
40
41
42
43
44
# File 'lib/animoto/assets/title_card.rb', line 38

def to_hash
  hash = { 'type' => 'title_card' }
  hash['h1'] = title
  hash['h2'] = subtitle if subtitle
  hash['spotlit'] = spotlit? unless @spotlit.nil?
  hash
end