Class: Chroma::PaletteBuilder::PaletteBuilderDsl
- Inherits:
-
Object
- Object
- Chroma::PaletteBuilder::PaletteBuilderDsl
- Defined in:
- lib/chroma/palette_builder.rb
Overview
Internal class for palette building DSL syntax.
Defined Under Namespace
Classes: ColorCalls
Instance Attribute Summary collapse
-
#evaluator ⇒ Object
readonly
Returns the value of attribute evaluator.
Instance Method Summary collapse
-
#initialize ⇒ PaletteBuilderDsl
constructor
A new instance of PaletteBuilderDsl.
- #method_missing(name, *args) ⇒ Object
Constructor Details
#initialize ⇒ PaletteBuilderDsl
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
#evaluator ⇒ Object (readonly)
Returns the value of attribute evaluator.
48 49 50 |
# File 'lib/chroma/palette_builder.rb', line 48 def evaluator @evaluator end |