Class: Chroma::PaletteBuilder::PaletteBuilderDsl

Inherits:
Object
  • Object
show all
Defined in:
lib/chroma/palette_builder.rb

Overview

Internal class for palette building DSL syntax.

Defined Under Namespace

Classes: ColorCalls

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePaletteBuilderDsl

Returns a new instance of PaletteBuilderDsl.



50
51
52
# File 'lib/chroma/palette_builder.rb', line 50

def initialize
  @evaluator = PaletteEvaluator.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



54
55
56
57
58
# File 'lib/chroma/palette_builder.rb', line 54

def method_missing(name, *args)
  ColorCalls.new(name, args).tap do |color_calls|
    @evaluator << color_calls
  end
end

Instance Attribute Details

#evaluatorObject (readonly)

Returns the value of attribute evaluator.



48
49
50
# File 'lib/chroma/palette_builder.rb', line 48

def evaluator
  @evaluator
end