Sha256: 9ead25095fe9c8d05a368f7176fbc50f5c0719cc8985ecdc5e2c1915de85220f

Contents?: true

Size: 364 Bytes

Versions: 8

Compression:

Stored size: 364 Bytes

Contents

begin
  # Add support for Hash#symbolize_keys:
  require 'active_support/core_ext/hash/keys'

rescue LoadError => e
  Hash.class_eval do
    unless respond_to?(:symbolize_keys)
      def symbolize_keys
        inject({}) do |options, (key, value)|
          options[(key.to_sym rescue key) || key] = value
          options
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hungry-0.2.0 lib/support/symbolize_keys.rb
hungry-0.1.5 lib/support/symbolize_keys.rb
hungry-0.1.4 lib/support/symbolize_keys.rb
hungry-0.1.3 lib/support/symbolize_keys.rb
hungry-0.1.2 lib/support/symbolize_keys.rb
hungry-0.1.1 lib/support/symbolize_keys.rb
hungry-0.1.0 lib/support/symbolize_keys.rb
hungry-0.0.1 lib/support/symbolize_keys.rb