Skip to content

Commit 6a26eec

Browse files
committed
updated docs
1 parent 2035b43 commit 6a26eec

1 file changed

Lines changed: 14 additions & 18 deletions

File tree

core/hash.rbs

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,11 @@ class Hash[unchecked out K, unchecked out V]
12051205
def fetch_values: (*_Key keys) -> Array[V]
12061206
| [K2 < _Key, T] (*K2 keys) { (K2 key) -> T } -> Array[V | T]
12071207

1208-
# <!-- rdoc-file=hash.c -->
1208+
# <!--
1209+
# rdoc-file=hash.c
1210+
# - select {|key, value| ... } -> new_hash
1211+
# - select -> new_enumerator
1212+
# -->
12091213
# With a block given, calls the block with each entry's key and value; returns a
12101214
# new hash whose entries are those for which the block returns a truthy value:
12111215
#
@@ -1219,7 +1223,11 @@ class Hash[unchecked out K, unchecked out V]
12191223
def select: () -> Enumerator[[ K, V ], Hash[K, V]]
12201224
| () { (K key, V value) -> boolish } -> Hash[K, V]
12211225

1222-
# <!-- rdoc-file=hash.c -->
1226+
# <!--
1227+
# rdoc-file=hash.c
1228+
# - select! {|key, value| ... } -> self or nil
1229+
# - select! -> new_enumerator
1230+
# -->
12231231
# With a block given, calls the block with each entry's key and value; removes
12241232
# from `self` each entry for which the block returns `false` or `nil`.
12251233
#
@@ -1423,8 +1431,7 @@ class Hash[unchecked out K, unchecked out V]
14231431

14241432
# <!--
14251433
# rdoc-file=hash.c
1426-
# - hash.length -> integer
1427-
# - hash.size -> integer
1434+
# - size -> integer
14281435
# -->
14291436
# Returns the count of entries in `self`:
14301437
#
@@ -1626,11 +1633,7 @@ class Hash[unchecked out K, unchecked out V]
16261633
#
16271634
def replace: (hash[K, V] other) -> self
16281635

1629-
# <!--
1630-
# rdoc-file=hash.c
1631-
# - select {|key, value| ... } -> new_hash
1632-
# - select -> new_enumerator
1633-
# -->
1636+
# <!-- rdoc-file=hash.c -->
16341637
# With a block given, calls the block with each entry's key and value; returns a
16351638
# new hash whose entries are those for which the block returns a truthy value:
16361639
#
@@ -1643,11 +1646,7 @@ class Hash[unchecked out K, unchecked out V]
16431646
#
16441647
alias filter select
16451648

1646-
# <!--
1647-
# rdoc-file=hash.c
1648-
# - select! {|key, value| ... } -> self or nil
1649-
# - select! -> new_enumerator
1650-
# -->
1649+
# <!-- rdoc-file=hash.c -->
16511650
# With a block given, calls the block with each entry's key and value; removes
16521651
# from `self` each entry for which the block returns `false` or `nil`.
16531652
#
@@ -1680,10 +1679,7 @@ class Hash[unchecked out K, unchecked out V]
16801679
#
16811680
def shift: () -> [ K, V ]?
16821681

1683-
# <!--
1684-
# rdoc-file=hash.c
1685-
# - size -> integer
1686-
# -->
1682+
# <!-- rdoc-file=hash.c -->
16871683
# Returns the count of entries in `self`:
16881684
#
16891685
# {foo: 0, bar: 1, baz: 2}.size # => 3

0 commit comments

Comments
 (0)