Module: Qonfig::Configurable

Defined in:
lib/qonfig/configurable.rb

Overview

Since:

  • 0.2.0

Defined Under Namespace

Modules: ClassInheritance, ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base_klass) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:

  • base_klass (Class)

Since:

  • 0.2.0



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/qonfig/configurable.rb', line 12

def included(base_klass)
  base_klass.instance_variable_set(:@__qonfig_access_lock__, Mutex.new)
  base_klass.instance_variable_set(:@__qonfig_definition_lock__, Mutex.new)
  base_klass.instance_variable_set(:@__qonfig_config_klass__, Class.new(Qonfig::DataSet))
  base_klass.instance_variable_set(:@__qonfig_config__, nil)

  base_klass.extend(ClassMethods)
  base_klass.include(InstanceMethods)
  base_klass.singleton_class.prepend(ClassInheritance)

  super
end