Class: DumpedRailers::Preprocessor::StripIgnorables

Inherits:
Object
  • Object
show all
Defined in:
lib/dumped_railers/preprocessor/strip_ignorables.rb

Instance Method Summary collapse

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