Sha256: c6c00a3b455a432e57f481c7924dafb39386ce342f7776de5e41f4c534a4bad0
Contents?: true
Size: 648 Bytes
Versions: 1
Compression:
Stored size: 648 Bytes
Contents
class ASE class Palette include Enumerable attr_accessor :name, :colors def initialize(name) @name = name @colors = {} end def add(name, color) @colors[name] = color end alias :[]= :add alias :add_color :add def remove(name) @colors.delete(name) end def [](i) @colors[i] end def length @colors.length end alias :size :length def each(&block) @colors.each(&block) end def method_missing(method, *args, &block) if @colors.has_key?(method.to_s) return @colors[method.to_s] end super end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ase-2.0.0 | lib/ase/palette.rb |