class Array
Extension class for Array
Public Instance Methods
cleanup()
click to toggle source
Removes all empty entries
# File lib/libis/tools/extend/array.rb, line 6 def cleanup self.delete_if { |v| v.nil? || (v.respond_to?(:empty?) ? v.empty? : false) } end
recursive_cleanup()
click to toggle source
Removes all empty entries recursively in the array and each Hash
in it
# File lib/libis/tools/extend/array.rb, line 11 def recursive_cleanup each { |v| v.recursive_cleanup if Array === v || Hash === v } cleanup end