Class: Spectra::Root
Instance Attribute Summary collapse
-
#_prefix ⇒ Object
Returns the value of attribute _prefix.
-
#colors ⇒ Object
Returns the value of attribute colors.
-
#serializers ⇒ Object
Returns the value of attribute serializers.
Instance Method Summary collapse
Methods included from DSL
#color, #components, #format, #formats, #hex, #prefix, #white
Instance Attribute Details
#_prefix ⇒ Object
Returns the value of attribute _prefix.
10 11 12 |
# File 'lib/spectra/models.rb', line 10 def _prefix @_prefix end |
#colors ⇒ Object
Returns the value of attribute colors.
11 12 13 |
# File 'lib/spectra/models.rb', line 11 def colors @colors end |
#serializers ⇒ Object
Returns the value of attribute serializers.
11 12 13 |
# File 'lib/spectra/models.rb', line 11 def serializers @serializers end |
Instance Method Details
#generate(definition) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/spectra/models.rb', line 15 def generate(definition) self.instance_eval(definition) self.formats(:palette, :objc) unless self.serializers self.serializers.each do |serializer| serializer.serialize({ colors: self.colors, prefix: self._prefix, }) end end |