Class: Probe::ColumnNotMatchesRegEx
- Inherits:
-
ColumnMeetsCondition
- Object
- RowMeetsCondition
- ColumnMeetsCondition
- Probe::ColumnNotMatchesRegEx
- Defined in:
- lib/csv/probe/checks.rb
Overview
Check if a column value is a date with a given format
Instance Attribute Summary
Attributes inherited from ColumnMeetsCondition
#fail_msg, #ok_condition_fn, #varname
Attributes inherited from RowMeetsCondition
#fail_msg, #ok_condition_fn, #pre_checks, #severity
Instance Method Summary collapse
-
#initialize(varname, expected_regex_pattern, _placeholder = nil) ⇒ ColumnNotMatchesRegEx
constructor
A new instance of ColumnNotMatchesRegEx.
Methods inherited from ColumnMeetsCondition
#evaluate, #render_pretty_fail_msg
Methods inherited from RowMeetsCondition
#error_msg, #evaluate, #evaluate_pre_checks, #render_fail_msg, #render_pretty_fail_msg, #report_columns_hash, #source_row, #source_row_location
Constructor Details
#initialize(varname, expected_regex_pattern, _placeholder = nil) ⇒ ColumnNotMatchesRegEx
Returns a new instance of ColumnNotMatchesRegEx.
193 194 195 196 197 |
# File 'lib/csv/probe/checks.rb', line 193 def initialize(varname, expected_regex_pattern, _placeholder = nil) super(varname, nil, nil) @ok_condition_fn = ->(val, _cfg) { val.to_s !~ expected_regex_pattern } @fail_msg = "expected to NOT match regex pattern #{expected_regex_pattern.inspect}" end |