Class: Chronicle::ETL::FilterFieldsTransformer
- Inherits:
-
Transformer
- Object
- Transformer
- Chronicle::ETL::FilterFieldsTransformer
- Defined in:
- lib/chronicle/etl/transformers/filter_fields_transformer.rb
Overview
A transformer that filters the fields of a record and returns a new hash with only the specified fields.
Instance Attribute Summary
Attributes inherited from Transformer
Attributes included from Registry::SelfRegistering
Instance Method Summary collapse
Methods inherited from Transformer
#call, #call_finish, #finish, #initialize
Methods included from Registry::SelfRegistering
Methods included from Configurable
Constructor Details
This class inherits a constructor from Chronicle::ETL::Transformer
Instance Method Details
#transform(record) ⇒ Object
14 15 16 17 |
# File 'lib/chronicle/etl/transformers/filter_fields_transformer.rb', line 14 def transform(record) hash = record.data.to_h.deep_transform_keys(&:to_sym) filter_hash(hash, @config.fields.map) end |