Sha256: dc216bb9b6599d10c718df7e5266896e5a975ca334ab1485901ffe42073f458f

Contents?: true

Size: 626 Bytes

Versions: 10

Compression:

Stored size: 626 Bytes

Contents

module Animoto
  class TitleCard
    include Animoto::Visual
    
    attr_accessor :title, :subtitle
    
    # Creates a new TitleCard.
    #
    # @param [String] title the main text
    # @param [String] subtitle the secondary text
    def initialize title, subtitle = nil
      @title, @subtitle = title, subtitle
    end
    
    # Returns a representation of this TitleCard as a Hash.
    #
    # @return [Hash] this TitleCard as a Hash
    def to_hash
      hash = super
      hash['h1'] = title
      hash['h2'] = subtitle if subtitle
      hash['spotlit'] = spotlit? unless @spotlit.nil?
      hash
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
animoto-0.0.0.alpha9 ./lib/animoto/title_card.rb
animoto-0.0.0.alpha8 ./lib/animoto/title_card.rb
animoto-0.0.0.alpha7 ./lib/animoto/title_card.rb
animoto-0.0.0.alpha6 ./lib/animoto/title_card.rb
animoto-0.0.0.alpha5 ./lib/animoto/title_card.rb
animoto-0.0.0.alpha4 ./lib/animoto/title_card.rb
animoto-0.0.0.alpha3 ./lib/animoto/title_card.rb
animoto-0.0.0.alpha2 ./lib/animoto/title_card.rb
animoto-0.0.0.alpha1 ./lib/animoto/title_card.rb
animoto-0.0.0.alpha0 ./lib/animoto/title_card.rb