Class: Orthor::Templates

Inherits:
Object
  • Object
show all
Defined in:
lib/orthor/templates.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.templatesObject

Returns the value of attribute templates.



4
5
6
# File 'lib/orthor/templates.rb', line 4

def templates
  @templates
end

Class Method Details

.[](key) ⇒ Object



16
17
18
19
# File 'lib/orthor/templates.rb', line 16

def [](key)
  @templates ||= {}
  @templates[key.to_s]
end

.define(&blk) ⇒ Object



6
7
8
9
# File 'lib/orthor/templates.rb', line 6

def define(&blk)
  @templates = {}
  class_eval &blk
end

.template(name, markup) ⇒ Object Also known as: add



11
12
13
# File 'lib/orthor/templates.rb', line 11

def template(name, markup)
  @templates[name.to_s] = markup
end