Sha256: 81ff1a1f004389d3304696d16615f0eebbacde0327e7b66abc3f578b3126f359

Contents?: true

Size: 919 Bytes

Versions: 4

Compression:

Stored size: 919 Bytes

Contents

module Animoto
  module Assets
    class TitleCard
      include Support::Visual
      
      # The main text of this title card.
      # @return [String]
      attr_accessor :title
      
      # The secondary text of this title card.
      # @return [String]
      attr_accessor :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{String=>Object}] this TitleCard as a Hash
      # @see Animoto::Support::Visual#to_hash
      def to_hash
        hash = super
        hash['h1'] = title
        hash['h2'] = subtitle if subtitle
        hash['spotlit'] = spotlit? unless @spotlit.nil?
        hash
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
animoto-1.2.0 ./lib/animoto/assets/title_card.rb
animoto-1.1.1 ./lib/animoto/assets/title_card.rb
animoto-1.1.0 ./lib/animoto/assets/title_card.rb
animoto-1.0.0 ./lib/animoto/assets/title_card.rb