Module: Confix::RootClassMethods

Defined in:
lib/confix.rb

Overview

Root class methods

Instance Method Summary collapse

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.

Raises:

  • (ArgumentError)


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

#templatesObject



157
158
159
# File 'lib/confix.rb', line 157

def templates
  @templates ||= {}
end