Sha256: 445169c52b4f03171c10e87e8235eaea711f727c240091a52dcc110f67911fe0

Contents?: true

Size: 847 Bytes

Versions: 3

Compression:

Stored size: 847 Bytes

Contents

module Animoto
  module Support
    module Visual
    
      # Setter for spotlighting, which instructs the director to give special attention
      # to this visual when directing.
      #
      # @param [Boolean] bool true if this visual should receive special attention
      def spotlit= bool
        @spotlit = bool
      end
    
      # Returns true if this visual is spotlit.
      #
      # @return [Boolean] whether or not this visual is spotlit
      def spotlit?
        @spotlit
      end

      # Returns a representation of this Visual as a Hash
      #
      # @return [Hash{String=>Object}] this Visual as a Hash
      def to_hash
        hash = super rescue {}
        hash['spotlit'] = spotlit? unless @spotlit.nil?
        hash['type'] = self.class.name.split('::').last.underscore
        hash
      end
    
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
animoto-1.2.0 ./lib/animoto/support/visual.rb
animoto-1.1.1 ./lib/animoto/support/visual.rb
animoto-1.1.0 ./lib/animoto/support/visual.rb