Class: Chicago::ETL::Screens::OutOfBounds

Inherits:
ColumnScreen show all
Defined in:
lib/chicago/etl/screens/out_of_bounds.rb

Overview

Screen which checks to see if a column’s value is out of defined bounds.

Instance Method Summary collapse

Methods inherited from ColumnScreen

#column, for_columns, #output_streams, #process_row

Methods inherited from Transformation

#added_fields, added_fields, adds_fields, #applies_to_stream?, #downstream_fields, #flush, #initialize, #output_streams, #process, #removed_fields, removed_fields, removes_fields, #required_options, required_options, requires_options, #upstream_fields

Constructor Details

This class inherits a constructor from Chicago::ETL::Transformation

Instance Method Details

#applies?(value) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
# File 'lib/chicago/etl/screens/out_of_bounds.rb', line 11

def applies?(value)
  return false unless value

  (column.numeric? && applies_to_numeric?(value)) ||
    (column.column_type == :string && applies_to_string?(value))
end

#overwrite_value(row) ⇒ Object



18
19
# File 'lib/chicago/etl/screens/out_of_bounds.rb', line 18

def overwrite_value(row)
end

#severityObject



7
8
9
# File 'lib/chicago/etl/screens/out_of_bounds.rb', line 7

def severity
  2
end