Module: Configurator
- Includes:
- Option
- Defined in:
- lib/configurator.rb,
lib/configurator/option.rb,
lib/configurator/configuration.rb
Defined Under Namespace
Modules: Option
Classes: Configuration
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.extended(base) ⇒ Object
7
8
9
|
# File 'lib/configurator.rb', line 7
def self.extended(base)
base.class_eval { remove_instance_variable(:@configuration) if defined? @configuration }
end
|
Instance Method Details
#config(&block) ⇒ Object
11
12
13
14
15
16
17
|
# File 'lib/configurator.rb', line 11
def config(&block)
@configuration ||= Configuration.new
if block_given?
@configuration.instance_exec(@configuration, &block)
end
@configuration
end
|