Class: Directive::ConfigBuilder

Inherits:
Object
  • Object
show all
Includes:
ActiveSupport::Callbacks, DoubleConfigure
Defined in:
lib/directive/config_builder.rb

Instance Method Summary collapse

Instance Method Details

#configureObject



21
22
23
24
25
26
27
# 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) ⇒ Object



34
35
36
# File 'lib/directive/config_builder.rb', line 34

def nested(namespace, &block)
  config_class.__send__(:nested, namespace, &block)
end

#option(*args, **kwargs, &block) ⇒ Object

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



30
31
32
# File 'lib/directive/config_builder.rb', line 30

def option(*args, **kwargs, &block)
  config_class.__send__(:option, *args, **kwargs, &block)
end

#readerObject



17
18
19
# File 'lib/directive/config_builder.rb', line 17

def reader
  @reader ||= Reader.new(configuration)
end