Class: Ductr::ETL::Control
- Inherits:
-
Object
- Object
- Ductr::ETL::Control
- Extended by:
- Forwardable
- Defined in:
- lib/ductr/etl/controls/control.rb
Overview
Base class for all types of ETL control.
Direct Known Subclasses
Class Attribute Summary collapse
-
.type ⇒ Symbol
The control type, written when registering the control into its adapter.
Instance Attribute Summary collapse
-
#adapter ⇒ Adapter
readonly
The control’s adapter.
-
#job_method ⇒ Symbol
readonly
The method to be called by the control.
-
#options ⇒ Hash
readonly
The configuration hash of the control’s adapter.
Instance Method Summary collapse
-
#call_method ⇒ Object
Invokes the job’s method linked to the control.
-
#initialize(job_method, adapter = nil, **options) ⇒ Control
constructor
Creates a new control based on the job instance and the configured adapter.
Constructor Details
#initialize(job_method, adapter = nil, **options) ⇒ Control
Creates a new control based on the job instance and the configured adapter.
39 40 41 42 43 |
# File 'lib/ductr/etl/controls/control.rb', line 39 def initialize(job_method, adapter = nil, **) @job_method = job_method @adapter = adapter @options = end |
Class Attribute Details
.type ⇒ Symbol
Returns The control type, written when registering the control into its adapter.
13 14 15 |
# File 'lib/ductr/etl/controls/control.rb', line 13 def type @type end |
Instance Attribute Details
#adapter ⇒ Adapter (readonly)
Returns The control’s adapter.
30 31 32 |
# File 'lib/ductr/etl/controls/control.rb', line 30 def adapter @adapter end |
#job_method ⇒ Symbol (readonly)
Returns The method to be called by the control.
24 25 26 |
# File 'lib/ductr/etl/controls/control.rb', line 24 def job_method @job_method end |
#options ⇒ Hash (readonly)
Returns The configuration hash of the control’s adapter.
27 28 29 |
# File 'lib/ductr/etl/controls/control.rb', line 27 def @options end |
Instance Method Details
#call_method ⇒ Object
Invokes the job’s method linked to the control.
21 |
# File 'lib/ductr/etl/controls/control.rb', line 21 def_delegator :@job_method, :call, :call_method |