class Directive::ConfigBuilder

Attributes

configure_called[W]

Public Instance Methods

configure() { |configuration| ... } click to toggle source
# File lib/directive/config_builder.rb, line 21
def configure
  run_callbacks :configure do
    mutex.synchronize do
      yield configuration
    end
  end
end
nested(namespace, &block) click to toggle source
# File lib/directive/config_builder.rb, line 34
def nested(namespace, &block)
  config_class.__send__(:nested, namespace, &block)
end
option(*args, **kwargs, &block) click to toggle source

NOTE: options must be set up before {#configure} is called

# File lib/directive/config_builder.rb, line 30
def option(*args, **kwargs, &block)
  config_class.__send__(:option, *args, **kwargs, &block)
end
reader() click to toggle source
# File lib/directive/config_builder.rb, line 17
def reader
  @reader ||= Reader.new(configuration)
end

Private Instance Methods

config_class() click to toggle source
# File lib/directive/config_builder.rb, line 46
def config_class
  @config_class ||= Class.new(ConfigObject)
end
configuration() click to toggle source
# File lib/directive/config_builder.rb, line 42
def configuration
  config_class.instance
end
mutex() click to toggle source
# File lib/directive/config_builder.rb, line 50
def mutex
  @mutex = Mutex.new
end