diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-04-16 03:16:40 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-04-16 03:16:40 +0000 |
commit | fc7676fcd6c66e6696008ef190d796d740b686a7 (patch) | |
tree | 6b19b6d6b9f6e0fab0c8b16b3fadb3a58efe7bbb | |
parent | db66739c7ce253a9051df316518948361787b50b (diff) | |
download | ruby-fc7676fcd6c66e6696008ef190d796d740b686a7.tar.gz |
* hash.c: Alias ENV.to_h to ENV.to_hash [ref #6276]
[rubyspec:6587eead7cd1]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | hash.c | 4 |
3 files changed, 20 insertions, 1 deletions
@@ -1,3 +1,16 @@ +Mon Apr 16 12:13:42 2012 Marc-Andre Lafortune <ruby-core@marc-andre.ca> + + * hash.c: Alias ENV.to_h to ENV.to_hash [ref #6276] + [rubyspec:6587eead7cd1] + * lib/ostruct.rb: Add OpenStruct#to_h [Feature #6276] + [ref #1400] [rubyspec:9e0250b2fc6f] + * struct.c: Add Struct#to_h [Feature #6276] + [ref #4862] [rubyspec:2082ef46d46e] + * object.c: Add NilClass#to_h [Feature #6276] + [ref #5008] [rubyspec:dc5ecddbd608] + * hash.c: Add Hash#to_h [Feature #6276] + [rubyspec:84b7fe3f24d2] + Mon Apr 16 09:42:50 2012 NAKAMURA Usaku <usa@ruby-lang.org> * lib/rubygems/remote_fetcher.rb (Gem::RemoteFetcher#download): should @@ -21,6 +21,10 @@ with all sufficient information, see the ChangeLog file. * added method: * added Enumerable#lazy method for lazy enumeration. + * ENV + * aliased method: + * ENV.to_h is a new alias for ENV.to_hash + * Hash * added method: * added Hash#to_h as explicit conversion method, like Array#to_a. @@ -3078,7 +3078,8 @@ env_index(VALUE dmy, VALUE value) /* * call-seq: - * ENV.to_hash -> Hash + * ENV.to_hash -> hash + * ENV.to_h -> hash * * Creates a hash with a copy of the environment variables. * @@ -3468,6 +3469,7 @@ Init_Hash(void) rb_define_singleton_method(envtbl,"key?", env_has_key, 1); rb_define_singleton_method(envtbl,"value?", env_has_value, 1); rb_define_singleton_method(envtbl,"to_hash", env_to_hash, 0); + rb_define_singleton_method(envtbl,"to_h", env_to_hash, 0); rb_define_singleton_method(envtbl,"assoc", env_assoc, 1); rb_define_singleton_method(envtbl,"rassoc", env_rassoc, 1); |