Sha256: 6d1442c6a31f815940fe95e7dd1bf6474b3b1870da5a58f1135a2b571fd86f39
Contents?: true
Size: 549 Bytes
Versions: 13
Compression:
Stored size: 549 Bytes
Contents
# Essential extensions to base object class module RedSnow # Class from MatterCompiler as ascendant class Object # Symbolizes keys of a hash def deep_symbolize_keys return self.inject({}){|memo, (k,v)| memo[k.to_sym] = v.deep_symbolize_keys; memo} if self.is_a? Hash return self.inject([]){|memo, v | memo << v.deep_symbolize_keys; memo} if self.is_a? Array return self end # Returns true if object is nil or empty, false otherwise def blank? respond_to?(:empty?) ? empty? : !self end end end
Version data entries
13 entries across 13 versions & 1 rubygems