Skip to content

Commit

Permalink
[DOC] Tweaks for rb_hash_s_create
Browse files Browse the repository at this point in the history
  • Loading branch information
BurdetteLamar authored and peterzhu2118 committed Jan 26, 2025
1 parent d4a1a27 commit b346b49
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -1791,7 +1791,7 @@ static VALUE rb_hash_to_a(VALUE hash);
/*
* call-seq:
* Hash[] -> new_empty_hash
* Hash[hash] -> new_hash
* Hash[other_hash] -> new_hash
* Hash[ [*2_element_arrays] ] -> new_hash
* Hash[*objects] -> new_hash
*
Expand All @@ -1800,20 +1800,20 @@ static VALUE rb_hash_to_a(VALUE hash);
*
* With no argument given, returns a new empty hash.
*
* With a single argument given that is a hash,
* returns a new hash initialized with the entries from +hash+
* With a single argument +other_hash+ given that is a hash,
* returns a new hash initialized with the entries from that hash
* (but not with its +default+ or +default_proc+):
*
* h = {foo: 0, bar: 1, baz: 2}
* Hash[h] # => {foo: 0, bar: 1, baz: 2}
*
* With a single argument given that is an array of 2-element arrays,
* With a single argument +2_element_arrays+ given that is an array of 2-element arrays,
* returns a new hash wherein each given 2-element array forms a
* key-value entry:
*
* Hash[ [ [:foo, 0], [:bar, 1] ] ] # => {foo: 0, bar: 1}
*
* With an even number of arguments given,
* With an even number of arguments +objects+ given,
* returns a new hash wherein each successive pair of arguments
* is a key-value entry:
*
Expand Down

0 comments on commit b346b49

Please sign in to comment.