Sha256: 20f5c643d0bab4fc7168b13d36b6592a7bd216d535a5619daec95b6429e5a2aa

Contents?: true

Size: 760 Bytes

Versions: 4

Compression:

Stored size: 760 Bytes

Contents

dir_root = File.dirname(File.absolute_path(__FILE__))

require dir_root + "/ase/version"
require dir_root + "/ase/color"
require dir_root + "/ase/file"
require dir_root + "/ase/palette"
require dir_root + "/ase/reader"
require dir_root + "/ase/writer"


class ASE
  include Reader
  include Writer

  attr_accessor :palettes

  def initialize(file=nil)
    @file = file
    @palettes = {}
  end

  def add_palette(palette)
    raise "Can only pass an ASE::Palette" unless palette.is_a?(ASE::Palette)
    @palettes[palette.name] = palette
  end
  alias :<< :add_palette

  def [](name)
    @palettes[name]
  end

  def method_missing(method, *args, &block)
    if @palettes.has_key?(method.to_s)
      return @palettes[method.to_s]
    end

    super
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ase-1.0.3 lib/ase.rb
ase-1.0.2 lib/ase.rb
ase-1.0.1 lib/ase.rb
ase-1.0.0 lib/ase.rb