Module: Chronicle::ETL::Configurable::InstanceMethods
- Defined in:
- lib/chronicle/etl/configurable.rb
Overview
Instance methods for classes that have Configurable mixed in
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Class Method Summary collapse
-
.settings ⇒ Object
Name of all settings available to this class.
Instance Method Summary collapse
-
#apply_options(options) ⇒ Object
Take given options and apply them to this class's settings and make them available in @config and validates that they conform to setting rules.
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
51 52 53 |
# File 'lib/chronicle/etl/configurable.rb', line 51 def config @config end |
Class Method Details
.settings ⇒ Object
Name of all settings available to this class
72 73 74 |
# File 'lib/chronicle/etl/configurable.rb', line 72 def self.settings self.class.all_settings.keys end |
Instance Method Details
#apply_options(options) ⇒ Object
Take given options and apply them to this class's settings and make them available in @config and validates that they conform to setting rules
56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/chronicle/etl/configurable.rb', line 56 def () .transform_keys!(&:to_sym) .each do |name, value| setting = self.class.all_settings[name] # Do nothing with a given option if it's not a connector setting next unless setting @config[name] = coerced_value(setting, name, value) end validate_config end |