221
222
223
-224
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
# File 'lib/kiba/extend/transforms/reshape/fields_to_field_group_with_constant.rb', line 198
-def initialize(fieldmap:, constant_target:, constant_value:, delim: Kiba::Extend.delim,
- replace_empty: true, treat_as_null: Kiba::Extend.nullvalue,
- enforce_evenness: true, evener: nil, uneven_warning: true,
+def initialize(fieldmap:,
+ constant_target:,
+ constant_value:,
+ delim: Kiba::Extend.delim,
+ replace_empty: true,
+ treat_as_null: Kiba::Extend.nullvalue,
+ enforce_evenness: true,
+ evener: nil,
+ uneven_warning: true,
remove_empty_groups: true)
@renamer = Rename::Fields.new(fieldmap: fieldmap)
@renamed = fieldmap.values
@@ -614,16 +638,28 @@
@uneven_warning = uneven_warning
@remove_empty_groups = remove_empty_groups
- @empty_replacer = Replace::EmptyFieldValues.new(fields: @renamed, value: treat_as_null, delim: delim,
- treat_as_null: treat_as_null)
- @even_xform = Clean::EvenFieldValues.new(fields: @renamed, evener: @evener, delim: delim,
- warn: uneven_warning)
+ @empty_replacer = Replace::EmptyFieldValues.new(
+ fields: @renamed,
+ value: treat_as_null,
+ delim: delim,
+ treat_as_null: treat_as_null
+ )
+ @even_xform = Clean::EvenFieldValues.new(
+ fields: @renamed,
+ evener: @evener,
+ delim: delim,
+ warn: uneven_warning
+ )
@group_cleaner = Delete::EmptyFieldGroups.new(
- groups: [[renamed,
- target].flatten], delim: delim, treat_as_null: treat_as_null
+ groups: [[renamed, target].flatten],
+ delim: delim,
+ treat_as_null: treat_as_null
+ )
+ @value_getter = Helpers::FieldValueGetter.new(
+ fields: renamed,
+ delim: delim,
+ treat_as_null: treat_as_null
)
- @value_getter = Helpers::FieldValueGetter.new(fields: renamed,
- delim: delim, treat_as_null: treat_as_null)
end
|
@@ -692,25 +728,37 @@
-227
-228
-229
-230
-231
-232
-233
-234
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
- # File 'lib/kiba/extend/transforms/reshape/fields_to_field_group_with_constant.rb', line 227
+ # File 'lib/kiba/extend/transforms/reshape/fields_to_field_group_with_constant.rb', line 245
def process(row)
renamer.process(row)
- empty_replacer.process(row) if replace_empty
- max_vals = find_max_vals(row)
- add_constant(row, max_vals)
- even_xform.process(row) if enforce_evenness
- group_cleaner.process(row) if remove_empty_groups
+ vals = value_getter.call(row)
+ if vals.empty?
+ row[target] = nil
+ else
+ empty_replacer.process(row) if replace_empty
+ max_vals = find_max_vals(row)
+ add_constant(row, max_vals)
+ even_xform.process(row) if enforce_evenness
+ group_cleaner.process(row) if remove_empty_groups
+ end
+ row
end
|
@@ -722,7 +770,7 @@
diff --git a/Kiba/Extend/Transforms/Reshape/SimplePivot.html b/Kiba/Extend/Transforms/Reshape/SimplePivot.html
index 2abc7bb8..70af6385 100644
--- a/Kiba/Extend/Transforms/Reshape/SimplePivot.html
+++ b/Kiba/Extend/Transforms/Reshape/SimplePivot.html
@@ -482,7 +482,7 @@
diff --git a/Kiba/Extend/Transforms/SepDeprecatable.html b/Kiba/Extend/Transforms/SepDeprecatable.html
index 39e0e4f5..0b5a1ef9 100644
--- a/Kiba/Extend/Transforms/SepDeprecatable.html
+++ b/Kiba/Extend/Transforms/SepDeprecatable.html
@@ -351,7 +351,7 @@
diff --git a/Kiba/Extend/Transforms/SingleWarnable.html b/Kiba/Extend/Transforms/SingleWarnable.html
index 11083cd4..00302ead 100644
--- a/Kiba/Extend/Transforms/SingleWarnable.html
+++ b/Kiba/Extend/Transforms/SingleWarnable.html
@@ -229,7 +229,7 @@
diff --git a/Kiba/Extend/Transforms/Sort.html b/Kiba/Extend/Transforms/Sort.html
index 7b8584e2..7cf2e839 100644
--- a/Kiba/Extend/Transforms/Sort.html
+++ b/Kiba/Extend/Transforms/Sort.html
@@ -125,7 +125,7 @@ Overview
diff --git a/Kiba/Extend/Transforms/Sort/ByFieldValue.html b/Kiba/Extend/Transforms/Sort/ByFieldValue.html
index 453ebf5a..20b9a246 100644
--- a/Kiba/Extend/Transforms/Sort/ByFieldValue.html
+++ b/Kiba/Extend/Transforms/Sort/ByFieldValue.html
@@ -680,7 +680,7 @@
diff --git a/Kiba/Extend/Transforms/Split.html b/Kiba/Extend/Transforms/Split.html
index 02317031..0c129478 100644
--- a/Kiba/Extend/Transforms/Split.html
+++ b/Kiba/Extend/Transforms/Split.html
@@ -117,7 +117,7 @@ Overview
diff --git a/Kiba/Extend/Transforms/Split/IntoMultipleColumns.html b/Kiba/Extend/Transforms/Split/IntoMultipleColumns.html
index d5792805..6d372efc 100644
--- a/Kiba/Extend/Transforms/Split/IntoMultipleColumns.html
+++ b/Kiba/Extend/Transforms/Split/IntoMultipleColumns.html
@@ -487,7 +487,7 @@
diff --git a/Kiba/Extend/Transforms/Split/PublicationStatement.html b/Kiba/Extend/Transforms/Split/PublicationStatement.html
index 83a9c0c2..9ad878d8 100644
--- a/Kiba/Extend/Transforms/Split/PublicationStatement.html
+++ b/Kiba/Extend/Transforms/Split/PublicationStatement.html
@@ -598,7 +598,7 @@
diff --git a/Kiba/Extend/Transforms/StringValue.html b/Kiba/Extend/Transforms/StringValue.html
index 20217fc3..c9da1297 100644
--- a/Kiba/Extend/Transforms/StringValue.html
+++ b/Kiba/Extend/Transforms/StringValue.html
@@ -132,7 +132,7 @@ Overview
diff --git a/Kiba/Extend/Transforms/StringValue/ToArray.html b/Kiba/Extend/Transforms/StringValue/ToArray.html
index 51a767dd..eb86a336 100644
--- a/Kiba/Extend/Transforms/StringValue/ToArray.html
+++ b/Kiba/Extend/Transforms/StringValue/ToArray.html
@@ -658,7 +658,7 @@
diff --git a/Kiba/Extend/Transforms/Take.html b/Kiba/Extend/Transforms/Take.html
index 8f573b9f..e81ce73f 100644
--- a/Kiba/Extend/Transforms/Take.html
+++ b/Kiba/Extend/Transforms/Take.html
@@ -115,7 +115,7 @@ Overview
diff --git a/Kiba/Extend/Transforms/Take/First.html b/Kiba/Extend/Transforms/Take/First.html
index 096c55d8..ea055ea6 100644
--- a/Kiba/Extend/Transforms/Take/First.html
+++ b/Kiba/Extend/Transforms/Take/First.html
@@ -336,7 +336,7 @@
diff --git a/Kiba/Extend/Transforms/Warn.html b/Kiba/Extend/Transforms/Warn.html
index b32f84ea..fc2b2c43 100644
--- a/Kiba/Extend/Transforms/Warn.html
+++ b/Kiba/Extend/Transforms/Warn.html
@@ -117,7 +117,7 @@ Overview
diff --git a/Kiba/Extend/Transforms/Warn/IfFieldValueMatches.html b/Kiba/Extend/Transforms/Warn/IfFieldValueMatches.html
index bea9047a..f6ab2339 100644
--- a/Kiba/Extend/Transforms/Warn/IfFieldValueMatches.html
+++ b/Kiba/Extend/Transforms/Warn/IfFieldValueMatches.html
@@ -525,7 +525,7 @@
diff --git a/Kiba/Extend/Transforms/Warn/UnevenFields.html b/Kiba/Extend/Transforms/Warn/UnevenFields.html
index df67b41d..049ac6fe 100644
--- a/Kiba/Extend/Transforms/Warn/UnevenFields.html
+++ b/Kiba/Extend/Transforms/Warn/UnevenFields.html
@@ -434,7 +434,7 @@
diff --git a/Kiba/Extend/Transforms/Warn/UnlessFieldValueMatches.html b/Kiba/Extend/Transforms/Warn/UnlessFieldValueMatches.html
index fdbad551..01c39131 100644
--- a/Kiba/Extend/Transforms/Warn/UnlessFieldValueMatches.html
+++ b/Kiba/Extend/Transforms/Warn/UnlessFieldValueMatches.html
@@ -524,7 +524,7 @@
diff --git a/Kiba/Extend/Utils.html b/Kiba/Extend/Utils.html
index 5a289cfb..6635b65c 100644
--- a/Kiba/Extend/Utils.html
+++ b/Kiba/Extend/Utils.html
@@ -109,7 +109,7 @@ Defined Under Namespace
diff --git a/Kiba/Extend/Utils/DelimInValueFingerprintError.html b/Kiba/Extend/Utils/DelimInValueFingerprintError.html
index 7c09175d..0e52bd9c 100644
--- a/Kiba/Extend/Utils/DelimInValueFingerprintError.html
+++ b/Kiba/Extend/Utils/DelimInValueFingerprintError.html
@@ -140,7 +140,7 @@ Overview
diff --git a/Kiba/Extend/Utils/ExtractFractions.html b/Kiba/Extend/Utils/ExtractFractions.html
index 89684a13..76d5ba02 100644
--- a/Kiba/Extend/Utils/ExtractFractions.html
+++ b/Kiba/Extend/Utils/ExtractFractions.html
@@ -344,7 +344,7 @@
diff --git a/Kiba/Extend/Utils/FieldValueMatcher.html b/Kiba/Extend/Utils/FieldValueMatcher.html
index 9cb66d9b..c3363496 100644
--- a/Kiba/Extend/Utils/FieldValueMatcher.html
+++ b/Kiba/Extend/Utils/FieldValueMatcher.html
@@ -618,7 +618,7 @@
diff --git a/Kiba/Extend/Utils/Fieldset.html b/Kiba/Extend/Utils/Fieldset.html
index 4282e906..179dc4cd 100644
--- a/Kiba/Extend/Utils/Fieldset.html
+++ b/Kiba/Extend/Utils/Fieldset.html
@@ -584,7 +584,7 @@
diff --git a/Kiba/Extend/Utils/FingerprintCreator.html b/Kiba/Extend/Utils/FingerprintCreator.html
index e565b45d..bad5c90d 100644
--- a/Kiba/Extend/Utils/FingerprintCreator.html
+++ b/Kiba/Extend/Utils/FingerprintCreator.html
@@ -382,7 +382,7 @@
diff --git a/Kiba/Extend/Utils/IterativeCleanupJobRegistrar.html b/Kiba/Extend/Utils/IterativeCleanupJobRegistrar.html
index 8102e146..36a98ad0 100644
--- a/Kiba/Extend/Utils/IterativeCleanupJobRegistrar.html
+++ b/Kiba/Extend/Utils/IterativeCleanupJobRegistrar.html
@@ -415,7 +415,7 @@
diff --git a/Kiba/Extend/Utils/Lookup.html b/Kiba/Extend/Utils/Lookup.html
index be61a7c0..8484b530 100644
--- a/Kiba/Extend/Utils/Lookup.html
+++ b/Kiba/Extend/Utils/Lookup.html
@@ -448,7 +448,7 @@
diff --git a/Kiba/Extend/Utils/Lookup/CriteriaChecker.html b/Kiba/Extend/Utils/Lookup/CriteriaChecker.html
index a76f1cfd..bc8efee6 100644
--- a/Kiba/Extend/Utils/Lookup/CriteriaChecker.html
+++ b/Kiba/Extend/Utils/Lookup/CriteriaChecker.html
@@ -385,7 +385,7 @@
diff --git a/Kiba/Extend/Utils/Lookup/FieldEmptiness.html b/Kiba/Extend/Utils/Lookup/FieldEmptiness.html
index 9b99069b..6ee8a5fe 100644
--- a/Kiba/Extend/Utils/Lookup/FieldEmptiness.html
+++ b/Kiba/Extend/Utils/Lookup/FieldEmptiness.html
@@ -281,7 +281,7 @@
diff --git a/Kiba/Extend/Utils/Lookup/MultivalPairs.html b/Kiba/Extend/Utils/Lookup/MultivalPairs.html
index a02a7005..bc359ced 100644
--- a/Kiba/Extend/Utils/Lookup/MultivalPairs.html
+++ b/Kiba/Extend/Utils/Lookup/MultivalPairs.html
@@ -337,7 +337,7 @@
diff --git a/Kiba/Extend/Utils/Lookup/PairEquality.html b/Kiba/Extend/Utils/Lookup/PairEquality.html
index 87ba323c..69917287 100644
--- a/Kiba/Extend/Utils/Lookup/PairEquality.html
+++ b/Kiba/Extend/Utils/Lookup/PairEquality.html
@@ -331,7 +331,7 @@
diff --git a/Kiba/Extend/Utils/Lookup/PairInclusion.html b/Kiba/Extend/Utils/Lookup/PairInclusion.html
index 4f8f4f9f..98f9a8d4 100644
--- a/Kiba/Extend/Utils/Lookup/PairInclusion.html
+++ b/Kiba/Extend/Utils/Lookup/PairInclusion.html
@@ -329,7 +329,7 @@
diff --git a/Kiba/Extend/Utils/Lookup/RowSelector.html b/Kiba/Extend/Utils/Lookup/RowSelector.html
index 58d8d6c8..a8f2ef9b 100644
--- a/Kiba/Extend/Utils/Lookup/RowSelector.html
+++ b/Kiba/Extend/Utils/Lookup/RowSelector.html
@@ -203,7 +203,7 @@
diff --git a/Kiba/Extend/Utils/Lookup/RowSelectorByHash.html b/Kiba/Extend/Utils/Lookup/RowSelectorByHash.html
index ad6dc497..bc4f661b 100644
--- a/Kiba/Extend/Utils/Lookup/RowSelectorByHash.html
+++ b/Kiba/Extend/Utils/Lookup/RowSelectorByHash.html
@@ -339,7 +339,7 @@
diff --git a/Kiba/Extend/Utils/Lookup/RowSelectorByLambda.html b/Kiba/Extend/Utils/Lookup/RowSelectorByLambda.html
index 96d5de1a..d120a908 100644
--- a/Kiba/Extend/Utils/Lookup/RowSelectorByLambda.html
+++ b/Kiba/Extend/Utils/Lookup/RowSelectorByLambda.html
@@ -384,7 +384,7 @@
diff --git a/Kiba/Extend/Utils/Lookup/RowSorter.html b/Kiba/Extend/Utils/Lookup/RowSorter.html
index 966bc80e..b77aabb5 100644
--- a/Kiba/Extend/Utils/Lookup/RowSorter.html
+++ b/Kiba/Extend/Utils/Lookup/RowSorter.html
@@ -517,7 +517,7 @@
diff --git a/Kiba/Extend/Utils/Lookup/RowSorter/MissingSortFieldError.html b/Kiba/Extend/Utils/Lookup/RowSorter/MissingSortFieldError.html
index 638f0c5f..6445a3b5 100644
--- a/Kiba/Extend/Utils/Lookup/RowSorter/MissingSortFieldError.html
+++ b/Kiba/Extend/Utils/Lookup/RowSorter/MissingSortFieldError.html
@@ -158,7 +158,7 @@ Methods included from
- Generated on Thu Sep 28 14:50:48 2023 by
+ Generated on Tue Nov 21 00:41:47 2023 by
yard
0.9.34 (ruby-3.1.4).
diff --git a/Kiba/Extend/Utils/Lookup/SetChecker.html b/Kiba/Extend/Utils/Lookup/SetChecker.html
index 36b73884..82a5bcb0 100644
--- a/Kiba/Extend/Utils/Lookup/SetChecker.html
+++ b/Kiba/Extend/Utils/Lookup/SetChecker.html
@@ -437,7 +437,7 @@
diff --git a/Kiba/Extend/Utils/LookupHash.html b/Kiba/Extend/Utils/LookupHash.html
index b4a6ba2e..5c925cfe 100644
--- a/Kiba/Extend/Utils/LookupHash.html
+++ b/Kiba/Extend/Utils/LookupHash.html
@@ -378,7 +378,7 @@
diff --git a/Kiba/Extend/Utils/MarcIdExtractor.html b/Kiba/Extend/Utils/MarcIdExtractor.html
index e4dbe7cf..bbbe1035 100644
--- a/Kiba/Extend/Utils/MarcIdExtractor.html
+++ b/Kiba/Extend/Utils/MarcIdExtractor.html
@@ -389,7 +389,7 @@
diff --git a/Kiba/Extend/Utils/MarcIdExtractor/ControlFieldsDoNotHaveSubfieldsError.html b/Kiba/Extend/Utils/MarcIdExtractor/ControlFieldsDoNotHaveSubfieldsError.html
index 98aac8be..644253ef 100644
--- a/Kiba/Extend/Utils/MarcIdExtractor/ControlFieldsDoNotHaveSubfieldsError.html
+++ b/Kiba/Extend/Utils/MarcIdExtractor/ControlFieldsDoNotHaveSubfieldsError.html
@@ -158,7 +158,7 @@ Methods included from
- Generated on Thu Sep 28 14:50:48 2023 by
+ Generated on Tue Nov 21 00:41:47 2023 by
yard
0.9.34 (ruby-3.1.4).
diff --git a/Kiba/Extend/Utils/MarcNameCleaner.html b/Kiba/Extend/Utils/MarcNameCleaner.html
index 0c968245..dcf48e4d 100644
--- a/Kiba/Extend/Utils/MarcNameCleaner.html
+++ b/Kiba/Extend/Utils/MarcNameCleaner.html
@@ -263,7 +263,7 @@
diff --git a/Kiba/Extend/Utils/MarcRoleTermCleaner.html b/Kiba/Extend/Utils/MarcRoleTermCleaner.html
index a9594bf2..122bfe44 100644
--- a/Kiba/Extend/Utils/MarcRoleTermCleaner.html
+++ b/Kiba/Extend/Utils/MarcRoleTermCleaner.html
@@ -285,7 +285,7 @@
diff --git a/Kiba/Extend/Utils/MultiSourceNormalizer.html b/Kiba/Extend/Utils/MultiSourceNormalizer.html
index b5453406..7f41ca40 100644
--- a/Kiba/Extend/Utils/MultiSourceNormalizer.html
+++ b/Kiba/Extend/Utils/MultiSourceNormalizer.html
@@ -459,7 +459,7 @@
diff --git a/Kiba/Extend/Utils/PreJobBackupTask.html b/Kiba/Extend/Utils/PreJobBackupTask.html
index b0ee32b3..9e8ab08e 100644
--- a/Kiba/Extend/Utils/PreJobBackupTask.html
+++ b/Kiba/Extend/Utils/PreJobBackupTask.html
@@ -348,7 +348,7 @@
diff --git a/Kiba/Extend/Utils/PreJobNukeTask.html b/Kiba/Extend/Utils/PreJobNukeTask.html
index 17554b41..8d7a2a48 100644
--- a/Kiba/Extend/Utils/PreJobNukeTask.html
+++ b/Kiba/Extend/Utils/PreJobNukeTask.html
@@ -278,7 +278,7 @@
diff --git a/Kiba/Extend/Utils/PreJobTask.html b/Kiba/Extend/Utils/PreJobTask.html
index bb8b13e0..faa42b8a 100644
--- a/Kiba/Extend/Utils/PreJobTask.html
+++ b/Kiba/Extend/Utils/PreJobTask.html
@@ -307,7 +307,7 @@
diff --git a/Kiba/Extend/Utils/StringNormalizer.html b/Kiba/Extend/Utils/StringNormalizer.html
index 08ff8eb6..07440b33 100644
--- a/Kiba/Extend/Utils/StringNormalizer.html
+++ b/Kiba/Extend/Utils/StringNormalizer.html
@@ -620,7 +620,7 @@
diff --git a/Runnable.html b/Runnable.html
index d8474e04..32cc5063 100644
--- a/Runnable.html
+++ b/Runnable.html
@@ -114,7 +114,7 @@
diff --git a/_index.html b/_index.html
index bb2ead1f..c62f1661 100644
--- a/_index.html
+++ b/_index.html
@@ -2074,7 +2074,7 @@ Namespace Listing A-Z
diff --git a/file.LICENSE.html b/file.LICENSE.html
index 529472fe..fda01fea 100644
--- a/file.LICENSE.html
+++ b/file.LICENSE.html
@@ -60,7 +60,7 @@
The MIT License (MIT)
Copyright (c) 2020 Kristina Spurgin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
diff --git a/file.README.html b/file.README.html
index fa4ca000..10548b2d 100644
--- a/file.README.html
+++ b/file.README.html
@@ -115,7 +115,7 @@ Contributing
diff --git a/file.cli.html b/file.cli.html
index bdf19e03..45a78f20 100644
--- a/file.cli.html
+++ b/file.cli.html
@@ -163,7 +163,7 @@ Architecture/design
diff --git a/file.common_patterns_tips_tricks.html b/file.common_patterns_tips_tricks.html
index b882f009..ab0fe446 100644
--- a/file.common_patterns_tips_tricks.html
+++ b/file.common_patterns_tips_tricks.html
@@ -227,7 +227,7 @@
- Generated on Thu Sep 28 14:50:45 2023 by
+ Generated on Tue Nov 21 00:41:45 2023 by
yard
0.9.34 (ruby-3.1.4).
diff --git a/file.contributing.html b/file.contributing.html
index 1e6c0061..ab19405b 100644
--- a/file.contributing.html
+++ b/file.contributing.html
@@ -330,7 +330,7 @@ Making a pull request
diff --git a/file.cookbook.html b/file.cookbook.html
index 0eab0551..e4b72a8c 100644
--- a/file.cookbook.html
+++ b/file.cookbook.html
@@ -491,7 +491,7 @@ Merging client correctio
diff --git a/file.file_registry_entry.html b/file.file_registry_entry.html
index 15944b12..d9714eb4 100644
--- a/file.file_registry_entry.html
+++ b/file.file_registry_entry.html
@@ -406,7 +406,7 @@
diff --git a/file.iterative_cleanup.html b/file.iterative_cleanup.html
index b67880ba..c56581bf 100644
--- a/file.iterative_cleanup.html
+++ b/file.iterative_cleanup.html
@@ -550,7 +550,7 @@ Final :cleanup_base_name__final
diff --git a/index.html b/index.html
index 8413bf85..f38c437c 100644
--- a/index.html
+++ b/index.html
@@ -115,7 +115,7 @@ Contributing
diff --git a/top-level-namespace.html b/top-level-namespace.html
index ec9b7ff1..461260c3 100644
--- a/top-level-namespace.html
+++ b/top-level-namespace.html
@@ -102,7 +102,7 @@ Defined Under Namespace