Sha256: 31a3449a9b3787593650fe76e45790dea97a7d5e721dc5c90121c72ad884e80e
Contents?: true
Size: 770 Bytes
Versions: 14
Compression:
Stored size: 770 Bytes
Contents
module Roqua module Healthy class MessageCleaner def initialize(message) @message = message end def message clean_hash(@message) end def clean(thing) case thing when Hash clean_hash(thing) when Array clean_array(thing) when String clean_string(thing) else thing end end def clean_hash(hash) hash.each do |key, value| hash[key] = clean(value) end hash end def clean_array(array) array.map do |value| clean(value) end end def clean_string(string) return '' if string == '""' string.strip end end end end
Version data entries
14 entries across 14 versions & 1 rubygems