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


41
42
43
# File 'lib/chroma/palette_builder.rb', line 41

def initialize
  @conversions = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object


45
46
47
48
49
# File 'lib/chroma/palette_builder.rb', line 45

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

Instance Attribute Details

#conversionsObject (readonly)

Returns the value of attribute conversions


39
40
41
# File 'lib/chroma/palette_builder.rb', line 39

def conversions
  @conversions
end