Sha256: cfe78fabbefac309b489577677c92d70e0a41f090b5dcd18284ce60b231ea5ce

Contents?: true

Size: 494 Bytes

Versions: 6

Compression:

Stored size: 494 Bytes

Contents

module SemiStatic
    module CoreExt #:nodoc:
        module Hash
            # Replace self with a hash whose keys have been converted to symbols.
            def symbolize_keys
                hash = to_a.inject({}) do |memo,item|
                    key, value = item
                    memo[key.to_sym] = value
                    memo
                end
                replace(hash)
            end
        end
    end
end

class Hash #:nodoc:
    include SemiStatic::CoreExt::Hash
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
zzot-semi-static-0.0.2 lib/semi-static/core_ext/hash.rb
zzot-semi-static-0.0.3 lib/semi-static/core_ext/hash.rb
zzot-semi-static-0.0.4 lib/semi-static/core_ext/hash.rb
zzot-semi-static-0.0.5 lib/semi-static/core_ext/hash.rb
zzot-semi-static-0.0.6 lib/semi-static/core_ext/hash.rb
zzot-zzot-semi-static-0.0.1 lib/semi-static/core_ext/hash.rb