diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-11 21:37:02 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-11 21:37:02 +0000 |
commit | 876a1a1fa304ae99f22ee1a8d4962fc1173d4372 (patch) | |
tree | d2796c1839def18e65dd4b8c17ef8f15d2c3cf9c /activesupport/lib | |
parent | fe8fb574c06156ca7eef7367c85bd12991948806 (diff) | |
download | rails-876a1a1fa304ae99f22ee1a8d4962fc1173d4372.tar.gz rails-876a1a1fa304ae99f22ee1a8d4962fc1173d4372.tar.bz2 rails-876a1a1fa304ae99f22ee1a8d4962fc1173d4372.zip |
Added Byte operations to Numeric, so 5.5.megabytes + 200.kilobytes #461 [Marcel Molina]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@393 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/core_ext.rb | 2 | ||||
-rw-r--r-- | activesupport/lib/misc.rb | 24 |
2 files changed, 1 insertions, 25 deletions
diff --git a/activesupport/lib/core_ext.rb b/activesupport/lib/core_ext.rb index d288fb7e31..573313e741 100644 --- a/activesupport/lib/core_ext.rb +++ b/activesupport/lib/core_ext.rb @@ -1 +1 @@ -Dir[File.dirname(__FILE__) + "/core_ext/*.rb"].each { |file| require(file) }
\ No newline at end of file +Dir[File.dirname(__FILE__) + "/core_ext/*.rb"].each { |file| require(file) } diff --git a/activesupport/lib/misc.rb b/activesupport/lib/misc.rb index d2c3d4a045..1ca00db1e7 100644 --- a/activesupport/lib/misc.rb +++ b/activesupport/lib/misc.rb @@ -6,27 +6,3 @@ def silence_warnings $VERBOSE = old_verbose end end - -class Hash - # Return a new hash with all keys converted to symbols. - def symbolize_keys - inject({}) do |options, (key, value)| - options[key.to_sym] = value - options - end - end - - # Destructively convert all keys to symbols. - def symbolize_keys! - keys.each do |key| - unless key.is_a?(Symbol) - self[key.to_sym] = self[key] - delete(key) - end - end - self - end - - alias_method :to_options, :symbolize_keys - alias_method :to_options!, :symbolize_keys! -end |