Module: Kiba::Extend::Transforms::MultivalPlusDelimDeprecatable
- Included in:
- Cspace::NormalizeForID
- Defined in:
- lib/kiba/extend/transforms/multival_plus_delim_deprecatable.rb
Overview
Mixin module to handle deprecating multival
param in transforms having
both multival
and delim
params.
Use/implementation
Classes deprecating multival
should:
ONE:
include MultivalPlusDelimDeprecatable
TWO: Change :initialize params from:
multival: trueorfalse
to:
multival: omitted = true
THREE: Include in class :initialize method:
@multival = set_multival(multival, omitted, self)
FOUR: ONLY if current default value for :multival param == true: Define a private :multival_default method that returns true:
def multival_default
true
end
Instance Method Summary collapse
Instance Method Details
#set_multival(multival, omitted, calledby) ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'lib/kiba/extend/transforms/multival_plus_delim_deprecatable.rb', line 48 def set_multival(multival, omitted, calledby) if omitted multival_default else warn("#{Kiba::Extend.warning_label}:\n"\ " #{calledby.class}: #{warning_body}") multival end end |