Method: ApimaticCalculator::APIHelper.clean_hash

Defined in:
lib/apimatic_calculator/api_helper.rb

.clean_hash(hash) ⇒ Object

Removes elements with empty values from a hash.

Parameters:

  • The (Hash)

    hash to clean.



154
155
156
# File 'lib/apimatic_calculator/api_helper.rb', line 154

def self.clean_hash(hash)
  hash.delete_if { |_key, value| value.to_s.strip.empty? }
end