Module: Wallaby::ParamsUtils
- Defined in:
- lib/utils/wallaby/params_utils.rb
Overview
Hash utils
Class Method Summary collapse
-
.presence(*params) ⇒ Hash
Combined hash that removes empty values.
Class Method Details
.presence(*params) ⇒ Hash
Returns combined hash that removes empty values.
9 10 11 |
# File 'lib/utils/wallaby/params_utils.rb', line 9 def presence(*params) params.reduce({}, :merge).delete_if { |_, v| v.nil? || v == '' } end |