diff --git a/compar.c b/compar.c index 0fb7e5f658..142cb12a0c 100644 --- a/compar.c +++ b/compar.c @@ -95,10 +95,13 @@ cmpint(VALUE x, VALUE y) /* * call-seq: - * obj > other -> true or false + * self > other -> true or false * - * Compares two objects based on the receiver's <=> - * method, returning true if it returns a value greater than 0. + * Returns whether +self+ is "greater than" +other+; + * equivalent to (self <=> other) > 0: + * + * 'foo' > 'foo' # => false + * 'food' > 'foo' # => true */ static VALUE diff --git a/hash.c b/hash.c index 28b7295164..c1cc13383b 100644 --- a/hash.c +++ b/hash.c @@ -4971,10 +4971,9 @@ rb_hash_ge(VALUE hash, VALUE other) /* * call-seq: - * self > other_hash -> true or false + * self > other -> true or false * - * Returns +true+ if the entries of +self+ are a proper superset of the entries of +other_hash+, - * +false+ otherwise: + * Returns whether the entries of +self+ are a proper superset of the entries of +other+: * * h = {foo: 0, bar: 1, baz: 2} * h > {foo: 0, bar: 1} # => true # Proper superset. diff --git a/numeric.c b/numeric.c index ef44febe1b..e8df2a6aa0 100644 --- a/numeric.c +++ b/numeric.c @@ -1638,7 +1638,8 @@ rb_float_cmp(VALUE x, VALUE y) * call-seq: * self > other -> true or false * - * Returns +true+ if +self+ is numerically greater than +other+: + * Returns whether the value of +self+ is greater than the value of +other+; + * +other+ must be numeric, but may not be Complex: * * 2.0 > 1 # => true * 2.0 > 1.0 # => true @@ -4958,7 +4959,8 @@ fix_gt(VALUE x, VALUE y) * call-seq: * self > other -> true or false * - * Returns +true+ if the value of +self+ is greater than that of +other+: + * Returns whether the value of +self+ is greater than the value of +other+; + * +other+ must be numeric, but may not be Complex: * * 1 > 0 # => true * 1 > 1 # => false diff --git a/object.c b/object.c index 2b3535158f..7dda2b6c0d 100644 --- a/object.c +++ b/object.c @@ -2009,14 +2009,23 @@ rb_mod_ge(VALUE mod, VALUE arg) /* * call-seq: - * mod > other -> true, false, or nil + * self > other -> true, false, or nil * - * Returns true if mod is an ancestor of other. Returns - * false if mod is the same as other - * or mod is a descendant of other. - * Returns nil if there's no relationship between the two. - * (Think of the relationship in terms of the class definition: - * "class A < B" implies "B > A".) + * If +self+ is a class, returns +true+ if +self+ is a superclass of +other+, + * returns +false+ if +self+ is the same as +other+ or if +self+ is a subclass + * of +other+, and returns +nil+ if there are no relationship between the two: + * + * Numeric > Float # => true + * Float > Numeric # => false + * Float > Float # => false + * Float > Hash # => nil + * + * If +self+ is a module, returns +true+ if +other+ includes +self+, + * returns +false+ if +self+ is the same as +other+ or if +self+ includes + * +other+, and returns +nil+ if there are no relationship between the two: + * + * Enumerable > Array # => true + * Enumerable > String # => nil * */