summaryrefslogtreecommitdiff
path: root/lib/set.rb
diff options
context:
space:
mode:
authorgsinclair <gsinclair@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-21 16:38:42 +0000
committergsinclair <gsinclair@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-21 16:38:42 +0000
commitd67106c081409e9dad99085c90f174f7e1da429f (patch)
tree5b6ff8385d4bb7f2a33b8ced0fe478dc1e01c049 /lib/set.rb
parentb95357be1a2f971fdd0a3e4514af519037cd19cd (diff)
Small changes to documentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/set.rb')
-rw-r--r--lib/set.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/set.rb b/lib/set.rb
index 40715edb36..37332e1fa6 100644
--- a/lib/set.rb
+++ b/lib/set.rb
@@ -48,7 +48,7 @@ class Set
#
# If a block is given, the elements of enum are preprocessed by the
# given block.
- def initialize(enum = nil, &block)
+ def initialize(enum = nil, &block) # :yields: o
@hash ||= Hash.new
enum.nil? and return
@@ -322,10 +322,10 @@ class Set
# require 'set'
# files = Set.new(Dir.glob("*.rb"))
# hash = files.classify { |f| File.mtime(f).year }
- # p hash #=> {2000=>#<Set: {"a.rb", "b.rb"}>,
- # # 2001=>#<Set: {"c.rb", "d.rb", "e.rb"}>,
- # # 2002=>#<Set: {"f.rb"}>}
- def classify
+ # p hash # => {2000=>#<Set: {"a.rb", "b.rb"}>,
+ # # 2001=>#<Set: {"c.rb", "d.rb", "e.rb"}>,
+ # # 2002=>#<Set: {"f.rb"}>}
+ def classify # :yields: o
h = {}
each { |i|
@@ -348,10 +348,10 @@ class Set
# require 'set'
# numbers = Set[1, 3, 4, 6, 9, 10, 11]
# set = numbers.divide { |i,j| (i - j).abs == 1 }
- # p set #=> #<Set: {#<Set: {1}>,
- # # #<Set: {11, 9, 10}>,
- # # #<Set: {3, 4}>,
- # # #<Set: {6}>}>
+ # p set # => #<Set: {#<Set: {1}>,
+ # # #<Set: {11, 9, 10}>,
+ # # #<Set: {3, 4}>,
+ # # #<Set: {6}>}>
def divide(&func)
if func.arity == 2
require 'tsort'