Class: ASE
- Inherits:
-
Object
- Object
- ASE
- Defined in:
- lib/ase/color.rb,
lib/ase.rb,
lib/ase/file.rb,
lib/ase/reader.rb,
lib/ase/writer.rb,
lib/ase/palette.rb,
lib/ase/version.rb
Overview
Nice little wrapper that lets us easily perform some functions on a given color.
Defined Under Namespace
Modules: Reader, Writer Classes: Color, File, Palette
Constant Summary collapse
- VERSION =
"1.0.3"
Instance Attribute Summary collapse
-
#palettes ⇒ Object
Returns the value of attribute palettes.
Instance Method Summary collapse
- #[](name) ⇒ Object
- #add_palette(palette) ⇒ Object (also: #<<)
-
#initialize(file = nil) ⇒ ASE
constructor
A new instance of ASE.
- #method_missing(method, *args, &block) ⇒ Object
Methods included from Writer
Methods included from Reader
Constructor Details
#initialize(file = nil) ⇒ ASE
Returns a new instance of ASE.
17 18 19 20 |
# File 'lib/ase.rb', line 17 def initialize(file=nil) @file = file @palettes = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/ase.rb', line 32 def method_missing(method, *args, &block) if @palettes.has_key?(method.to_s) return @palettes[method.to_s] end super end |
Instance Attribute Details
#palettes ⇒ Object
Returns the value of attribute palettes.
15 16 17 |
# File 'lib/ase.rb', line 15 def palettes @palettes end |
Instance Method Details
#[](name) ⇒ Object
28 29 30 |
# File 'lib/ase.rb', line 28 def [](name) @palettes[name] end |