Class: Hash
- Includes:
- JamfRubyExtensions::Hash::Utils
- Defined in:
- lib/jamf/ruby_extensions/hash.rb
Overview
include the modules loaded above
Instance Method Summary collapse
-
#j_nillify!(to_nils = '', recurse = false) {|value| ... } ⇒ Hash
(also: #jss_nillify!)
included
from JamfRubyExtensions::Hash::Utils
Convert Hash values to nil.
Instance Method Details
#j_nillify!(to_nils = '', recurse = false) {|value| ... } ⇒ Hash Also known as: jss_nillify! Originally defined in module JamfRubyExtensions::Hash::Utils
Convert Hash values to nil. This is useful in the Classic API due to lack of consistency as to whether unset values come to us as nils or empty strings. This APIObject class converts all empty strings to nils using this method.
With no block, values equalling the String, or any member of the Array, given will be converted to nil. Equality is evaluated with == and Array#include?
With a block, if the result of the block evaluates to true, the value is converted to nil.
Subhashes are ignored unless recurse is true.