Sha256: 3d0447df59a90fca9c7d1ff33371269ce3e5d0125a097732ce9f2aacaeff3f32

Contents?: true

Size: 319 Bytes

Versions: 6

Compression:

Stored size: 319 Bytes

Contents

class Hash
   def deep_symbolize
      self.inject({}) do |new_hash, (key,value)| 
            new_hash[key.to_sym] = value.deep_symbolize
            new_hash
      end
   end
end

class Array
   def deep_symbolize
      map(&:deep_symbolize)
   end
end

class Object
   def deep_symbolize
      return self
   end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cloudconvert-ruby-0.1.9 lib/cloud_convert/lib/deep_symbolize.rb
cloudconvert-ruby-0.2.0 lib/cloud_convert/lib/deep_symbolize.rb
cloudconvert-ruby-0.1.8 lib/cloud_convert/lib/deep_symbolize.rb
cloudconvert-ruby-0.1.2 lib/cloud_convert/lib/deep_symbolize.rb
cloudconvert-ruby-0.1.1 lib/cloud_convert/lib/deep_symbolize.rb
cloudconvert-ruby-0.1.0 lib/cloud_convert/lib/deep_symbolize.rb