From aa66f59c97bfdf53e7232d8cf9aa5bd2335666df Mon Sep 17 00:00:00 2001 From: zzak Date: Wed, 7 Aug 2013 00:02:17 +0000 Subject: * string.c: [DOC] Description of rb_str_equal [Fixes GH-375] Based on a patch by @markijbema https://github.com/ruby/ruby/pull/375 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ string.c | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 928babe8d0..4162762e1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Aug 7 09:00:24 2013 Zachary Scott + + * string.c: [DOC] Description of rb_str_equal [Fixes GH-375] + Based on a patch by @markijbema + https://github.com/ruby/ruby/pull/375 + Wed Aug 7 08:30:38 2013 Zachary Scott * ext/openssl/ossl_hmac.c: [DOC] Documentation for OpenSSL::HMAC diff --git a/string.c b/string.c index b85fb5d960..81a368f4e5 100644 --- a/string.c +++ b/string.c @@ -2400,9 +2400,14 @@ str_eql(const VALUE str1, const VALUE str2) * str == obj -> true or false * str === obj -> true or false * - * Equality---If obj is not a String, returns - * false. Otherwise, returns true if str - * <=> obj returns zero. + * === Equality + * + * Returns whether +str+ == +obj+, similar to Object#==. + * + * If +obj+ is not an instance of String but responds to +to_str+, then the + * two strings are compared using case equality Object#===. + * + * Otherwise, returns similarly to String#eql?, comparing length and content. */ VALUE -- cgit v1.2.3