Class: DumpedRailers::Preprocessor::StripIgnorables
- Inherits:
-
Object
- Object
- DumpedRailers::Preprocessor::StripIgnorables
- Defined in:
- lib/dumped_railers/preprocessor/strip_ignorables.rb
Instance Method Summary collapse
- #call(_model, attributes) ⇒ Object
-
#initialize(*ignorable_columns) ⇒ StripIgnorables
constructor
A new instance of StripIgnorables.
Constructor Details
#initialize(*ignorable_columns) ⇒ StripIgnorables
Returns a new instance of StripIgnorables.
6 7 8 |
# File 'lib/dumped_railers/preprocessor/strip_ignorables.rb', line 6 def initialize(*ignorable_columns) @ignorable_columns = ignorable_columns.compact.map(&:to_s) end |
Instance Method Details
#call(_model, attributes) ⇒ Object
10 11 12 13 14 |
# File 'lib/dumped_railers/preprocessor/strip_ignorables.rb', line 10 def call(_model, attributes) attributes.delete_if { |column_name, _v| @ignorable_columns.include?(column_name) } end |