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
-
#conversions ⇒ Object
readonly
Returns the value of attribute conversions.
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.
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
#conversions ⇒ Object (readonly)
Returns the value of attribute conversions.
39 40 41 |
# File 'lib/chroma/palette_builder.rb', line 39 def conversions @conversions end |