Module: Chronicle::ETL::Configurable

Included in:
Extractor, Loader, Transformer
Defined in:
lib/chronicle/etl/configurable.rb

Overview

A mixin that gives a class a ClassMethods#setting macro to define settings and their properties (require, type, etc)

Examples:

Basic usage

class Test < Chronicle::ETL::Extractor
  include Chronicle::ETL::Configurable
  setting :when, type: :date, required: true
end

t = Test.new(when: '2022-02-24')
t.config.when

Defined Under Namespace

Modules: ClassMethods, Initializer, InstanceMethods Classes: Config

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



34
35
36
37
38
# File 'lib/chronicle/etl/configurable.rb', line 34

def self.included(klass)
  klass.extend(ClassMethods)
  klass.include(InstanceMethods)
  klass.prepend(Initializer)
end