Class: Themify::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/themify/template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, colors) ⇒ Template

Creates a new template Takes an hash as argument { ‘primary’: ‘#ccffee’ }



12
13
14
15
16
# File 'lib/themify/template.rb', line 12

def initialize(name, colors)
  raise 'You should pass an hash of key values for colors and a string as name' unless colors.instance_of?(Hash) && name.instance_of?(String)
  @name = name
  @colors = colors
end

Instance Attribute Details

#colorsObject (readonly)

Returns the value of attribute colors.



3
4
5
# File 'lib/themify/template.rb', line 3

def colors
  @colors
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/themify/template.rb', line 4

def name
  @name
end