aboutsummaryrefslogtreecommitdiffstats
path: root/lib/abbrev.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-07 23:55:53 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-07 23:55:53 +0000
commit79f28211fdf79759de17cd1c45ddeed460c0b0da (patch)
treee0d8ee55565c97e625e6b2fa80fb65a5d6a0ba60 /lib/abbrev.rb
parentc047e1ec12cfb945988a7b243e02b82121880975 (diff)
downloadruby-79f28211fdf79759de17cd1c45ddeed460c0b0da.tar.gz
* lib/abbrev.rb: Fixed typo in abbrev pattern documentation. Based on
patch by Mark Rushakoff. [ruby-trunk - #6346] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/abbrev.rb')
-rw-r--r--lib/abbrev.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/abbrev.rb b/lib/abbrev.rb
index d3ef272219..aac953aa82 100644
--- a/lib/abbrev.rb
+++ b/lib/abbrev.rb
@@ -38,8 +38,8 @@ module Abbrev
# would be "co", "con", and "cone".
#
# The optional +pattern+ parameter is a pattern or a string. Only
- # those input strings matching the pattern, or begging the string,
- # are considered for inclusion in the output hash
+ # input strings that match the pattern or start with the string
+ # are included in the output hash.
def abbrev(words, pattern = nil)
table = {}
@@ -81,12 +81,17 @@ end
class Array
# Calculates the set of unambiguous abbreviations for the strings in
- # +self+. If passed a pattern or a string, only the strings matching
- # the pattern or starting with the string are considered.
+ # +self+.
+ #
+ # The optional +pattern+ parameter is a pattern or a string. Only
+ # input strings that match the pattern or start with the string
+ # are included in the output hash.
#
# %w{ car cone }.abbrev #=> { "ca" => "car", "car" => "car",
# "co" => "cone", "con" => "cone",
# "cone" => "cone" }
+ #
+ # See also Abbrev#abbrev
def abbrev(pattern = nil)
Abbrev::abbrev(self, pattern)
end