Module: Confix::RootClassMethods
- Defined in:
- lib/confix.rb
Overview
Root class methods
Instance Method Summary collapse
-
#template(name, &block) ⇒ Object
Defines a reusable configuration template.
- #templates ⇒ Object
Instance Method Details
#template(name, &block) ⇒ Object
Defines a reusable configuration template. If you specify a configuration you may refer to this template rather than specifying a block.
152 153 154 155 |
# File 'lib/confix.rb', line 152 def template(name, &block) raise ArgumentError, "block required" unless block templates[name.to_s] = block end |
#templates ⇒ Object
157 158 159 |
# File 'lib/confix.rb', line 157 def templates @templates ||= {} end |