aboutsummaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorBurdette Lamar <BurdetteLamar@Yahoo.com>2020-08-27 14:54:36 -0500
committerGitHub <noreply@github.com>2020-08-27 14:54:36 -0500
commit8095114f1715070fcdc2b29303dcf55a7fcc32a3 (patch)
treefa53cb772e4deb1389c5fb2db1b567d4f0e48d43 /hash.c
parent029c7e60454932d63889e1085b51d645b6ab5942 (diff)
downloadruby-8095114f1715070fcdc2b29303dcf55a7fcc32a3.tar.gz
Comply with guide for method doc: hash.c (#3466)
Instance methods considered (most unchanged): - any - dig - \<= - \< - \>= - \> - to_proc
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/hash.c b/hash.c
index b6f93657bf..c20ceb329b 100644
--- a/hash.c
+++ b/hash.c
@@ -4515,12 +4515,8 @@ any_p_i_pattern(VALUE key, VALUE value, VALUE arg)
* Returns +true+ if any element satisfies a given criterion;
* +false+ otherwise.
*
- * ---
- *
* With no argument and no block,
- * returns +true+ if +self+ is non-empty; +false+ if empty:
- * {}.any? # => false
- * {nil => false}.any? # => true
+ * returns +true+ if +self+ is non-empty; +false+ if empty.
*
* With argument +object+ and no block,
* returns +true+ if for any key +key+
@@ -4537,13 +4533,6 @@ any_p_i_pattern(VALUE key, VALUE value, VALUE arg)
* h = {foo: 0, bar: 1, baz: 2}
* h.any? {|key, value| value < 3 } # => true
* h.any? {|key, value| value > 3 } # => false
- *
- * With argument +object+ and a block,
- * issues a warning ('given block not used') and ignores the block:
- * h = {foo: 0, bar: 1, baz: 2}
- * h.any?([:bar, 1]) # => true
- * h.any?([:bar, 0]) # => false
- * h.any?([:baz, 1]) # => false
*/
static VALUE
@@ -4584,22 +4573,14 @@ rb_hash_any_p(int argc, VALUE *argv, VALUE hash)
* The nested objects may be instances of various classes.
* See {Dig Methods}[rdoc-ref:doc/dig_methods.rdoc].
*
- * Examples:
+ * Nested Hashes:
* h = {foo: {bar: {baz: 2}}}
* h.dig(:foo) # => {:bar=>{:baz=>2}}
* h.dig(:foo, :bar) # => {:bar=>{:baz=>2}}
* h.dig(:foo, :bar, :baz) # => 2
* h.dig(:foo, :bar, :BAZ) # => nil
*
- * The nested objects may include any that respond to \#dig. See:
- * - Hash#dig
- * - Array#dig
- * - Struct#dig
- * - OpenStruct#dig
- * - CSV::Table#dig
- * - CSV::Row#dig
- *
- * Example:
+ * Nested Hashes and Arrays:
* h = {foo: {bar: [:a, :b, :c]}}
* h.dig(:foo, :bar, 2) # => :c
*