Sha256: 38b8cb0199959fbc88f55f131fea90b6d0919515fddca2984562accbc6bbb0a0

Contents?: true

Size: 918 Bytes

Versions: 3

Compression:

Stored size: 918 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

3 entries across 3 versions & 1 rubygems

Version Path
animoto-0.1.1.beta1 ./lib/animoto/assets/title_card.rb
animoto-0.1.0.beta1 ./lib/animoto/assets/title_card.rb
animoto-0.1.0.beta0 ./lib/animoto/assets/title_card.rb