diff options
author | Kenichi Kamiya <[email protected]> | 2019-06-21 12:28:28 +0900 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2019-06-21 18:25:01 +0200 |
commit | d01fd821875b989affc36e54e98f5dd67f47062e (patch) | |
tree | e34d7777ea878d7a5cc78d3429b3014dcccdf937 /hash.c | |
parent | 3b2d11ad90fcb64b41acc9006dfd1e40b4bd9000 (diff) |
Alias ENV.merge! as ENV.update
[Feature #15947]
Closes: https://github.com/ruby/ruby/pull/2246
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -5788,6 +5788,8 @@ env_update_i(VALUE key, VALUE val) * call-seq: * ENV.update(hash) -> Hash * ENV.update(hash) { |name, old_value, new_value| block } -> Hash + * ENV.merge!(hash) -> Hash + * ENV.merge!(hash) { |name, old_value, new_value| block } -> Hash * * Adds the contents of +hash+ to the environment variables. If no block is * specified entries with duplicate keys are overwritten, otherwise the value @@ -6059,6 +6061,7 @@ Init_Hash(void) rb_define_singleton_method(envtbl, "invert", env_invert, 0); rb_define_singleton_method(envtbl, "replace", env_replace, 1); rb_define_singleton_method(envtbl, "update", env_update, 1); + rb_define_singleton_method(envtbl, "merge!", env_update, 1); rb_define_singleton_method(envtbl, "inspect", env_inspect, 0); rb_define_singleton_method(envtbl, "rehash", env_none, 0); rb_define_singleton_method(envtbl, "to_a", env_to_a, 0); |