aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-05-11 16:42:23 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-05-11 16:42:23 -0500
commit7bf6edf819adf48b253dce7673ec82cda821646b (patch)
tree5da2d82b249806c8813e76c61bea74649fee6777 /activesupport/lib
parentef440bb0c3378a04300c592ec8432d26afc6ad1d (diff)
downloadrails-7bf6edf819adf48b253dce7673ec82cda821646b.tar.gz
rails-7bf6edf819adf48b253dce7673ec82cda821646b.tar.bz2
rails-7bf6edf819adf48b253dce7673ec82cda821646b.zip
added examples to String#exclude?
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/string/exclude.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/exclude.rb b/activesupport/lib/active_support/core_ext/string/exclude.rb
index 5e184ec1b3..114bcb87f0 100644
--- a/activesupport/lib/active_support/core_ext/string/exclude.rb
+++ b/activesupport/lib/active_support/core_ext/string/exclude.rb
@@ -1,5 +1,10 @@
class String
- # The inverse of <tt>String#include?</tt>. Returns true if the string does not include the other string.
+ # The inverse of <tt>String#include?</tt>. Returns true if the string
+ # does not include the other string.
+ #
+ # "hello".exclude? "lo" #=> false
+ # "hello".exclude? "ol" #=> true
+ # "hello".exclude? ?h #=> false
def exclude?(string)
!include?(string)
end