Module: Kiba::Extend::Transforms::SingleWarnable
- Included in:
- Collapse::FieldsWithCustomFieldmap, Cspace::AddressCountry, Merge::ConstantValue, Rename::Field, Warn::IfFieldValueMatches, Warn::UnlessFieldValueMatches
- Defined in:
- lib/kiba/extend/transforms/single_warnable.rb
Overview
Mixin module providing do_warnings
method for transforms.
If you have an input with 1000 rows missing an expected field, you don’t want 1000 warnings to STDOUT, so this handles ensuring a single warning will be sent
Usage
Transform classes using this should: include SingleWarnable
.
The initialize
method of a transform using this mixin should call setup_single_warning
. Then,
add_single_warning("The warning message")
can be used from anywhere else in the transform.
Class Method Summary collapse
Class Method Details
.single_warnings ⇒ Object
38 39 40 |
# File 'lib/kiba/extend/transforms/single_warnable.rb', line 38 def single_warnings @single_warnings end |