Class: Chronicle::ETL::Registry::ConnectorRegistration
- Inherits:
-
Object
- Object
- Chronicle::ETL::Registry::ConnectorRegistration
- Defined in:
- lib/chronicle/etl/registry/connector_registration.rb
Overview
Records details about a connector such as its source provider and a description
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#from_schema ⇒ Object
Returns the value of attribute from_schema.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#source ⇒ Object
Returns the value of attribute source.
-
#strategy ⇒ Object
Returns the value of attribute strategy.
-
#to_schema ⇒ Object
Returns the value of attribute to_schema.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#built_in? ⇒ Boolean
Whether this connector is built-in to Chronicle.
- #descriptive_phrase ⇒ Object
-
#initialize(klass) ⇒ ConnectorRegistration
constructor
Create a new connector registration.
- #klass_name ⇒ Object
-
#phase ⇒ Object
The ETL phase of this connector.
-
#plugin ⇒ Object
TODO: allow overriding here.
- #to_s ⇒ Object
Constructor Details
#initialize(klass) ⇒ ConnectorRegistration
Create a new connector registration
11 12 13 |
# File 'lib/chronicle/etl/registry/connector_registration.rb', line 11 def initialize(klass) @klass = klass end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
8 9 10 |
# File 'lib/chronicle/etl/registry/connector_registration.rb', line 8 def description @description end |
#from_schema ⇒ Object
Returns the value of attribute from_schema.
8 9 10 |
# File 'lib/chronicle/etl/registry/connector_registration.rb', line 8 def from_schema @from_schema end |
#identifier ⇒ Object
Returns the value of attribute identifier.
8 9 10 |
# File 'lib/chronicle/etl/registry/connector_registration.rb', line 8 def identifier @identifier end |
#klass ⇒ Object
Returns the value of attribute klass.
8 9 10 |
# File 'lib/chronicle/etl/registry/connector_registration.rb', line 8 def klass @klass end |
#source ⇒ Object
Returns the value of attribute source.
8 9 10 |
# File 'lib/chronicle/etl/registry/connector_registration.rb', line 8 def source @source end |
#strategy ⇒ Object
Returns the value of attribute strategy.
8 9 10 |
# File 'lib/chronicle/etl/registry/connector_registration.rb', line 8 def strategy @strategy end |
#to_schema ⇒ Object
Returns the value of attribute to_schema.
8 9 10 |
# File 'lib/chronicle/etl/registry/connector_registration.rb', line 8 def to_schema @to_schema end |
#type ⇒ Object
Returns the value of attribute type.
8 9 10 |
# File 'lib/chronicle/etl/registry/connector_registration.rb', line 8 def type @type end |
Instance Method Details
#built_in? ⇒ Boolean
Whether this connector is built-in to Chronicle
31 32 33 |
# File 'lib/chronicle/etl/registry/connector_registration.rb', line 31 def built_in? @klass.to_s.include? 'Chronicle::ETL' end |
#descriptive_phrase ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/chronicle/etl/registry/connector_registration.rb', line 44 def descriptive_phrase prefix = case phase when :extractor 'Extracts from' when :transformer 'Transforms' when :loader 'Loads to' end "#{prefix} #{description}" end |
#klass_name ⇒ Object
35 36 37 |
# File 'lib/chronicle/etl/registry/connector_registration.rb', line 35 def klass_name @klass.to_s end |
#phase ⇒ Object
The ETL phase of this connector
16 17 18 19 20 21 22 23 24 |
# File 'lib/chronicle/etl/registry/connector_registration.rb', line 16 def phase if klass.ancestors.include? Chronicle::ETL::Extractor :extractor elsif klass.ancestors.include? Chronicle::ETL::Transformer :transformer elsif klass.ancestors.include? Chronicle::ETL::Loader :loader end end |
#plugin ⇒ Object
TODO: allow overriding here. Maybe through self-registration process
40 41 42 |
# File 'lib/chronicle/etl/registry/connector_registration.rb', line 40 def plugin @source end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/chronicle/etl/registry/connector_registration.rb', line 26 def to_s "#{phase}-#{identifier}" end |