Sha256: 4b3a59c1c45761a2a7ec9e9f31671fafa209291be79549e2a606e4091588f600

Contents?: true

Size: 806 Bytes

Versions: 10

Compression:

Stored size: 806 Bytes

Contents

module Animoto
  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] this Visual as a Hash
    def to_hash
      hash = super rescue {}
      hash['spotlit'] = spotlit? unless @spotlit.nil?
      hash['type'] = self.class.name.split('::').last.gsub(/(^)?([A-Z])/) { "#{'_' unless $1}#{$2.downcase}" }
      hash
    end
    
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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