Module: BatchKit::Configurable

Included in:
Job
Defined in:
lib/batch-kit/configurable.rb

Overview

Adds a configure class method that can be used to load a configuration file and make it available to the class and instances of it.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Used to extend the including class with the class methods defined in ClassMethods.



51
52
53
# File 'lib/batch-kit/configurable.rb', line 51

def self.included(base)
    base.extend(ClassMethods)
end

Instance Method Details

#configBatchKit::Config

Each object instance gets its own copy of the class configuration, so that any modifications they make are local to the object instance.

Returns:

  • (BatchKit::Config)

    a copy of the class configuration specific to this instance.



61
62
63
# File 'lib/batch-kit/configurable.rb', line 61

def config
    @config ||= self.class.config.clone
end