summaryrefslogtreecommitdiffstats
path: root/lib/set.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-05 14:59:46 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-02-05 14:59:46 +0000
commit23499e2e82add5d59aa7bee417d8437699428f7e (patch)
tree7e25fe244595c7850d5bf03a30ee5520e76eddae /lib/set.rb
parent77f610c3160cb451849c2bd931ac6984435247a0 (diff)
downloadruby-23499e2e82add5d59aa7bee417d8437699428f7e.tar.gz
ruby-23499e2e82add5d59aa7bee417d8437699428f7e.tar.xz
ruby-23499e2e82add5d59aa7bee417d8437699428f7e.zip
* lib/prettyprint.rb (PrettyPrint#seplist): added.
* lib/pp.rb (PPMethods#pp_object): use seplist. (PPMethods#pp_hash): ditto. (Array#pretty_print): ditto. (Struct#pretty_print): ditto. (MatchData#pretty_print): ditto. * lib/set.rb (Set#pretty_print): use seplist. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@5623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/set.rb')
-rw-r--r--lib/set.rb9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/set.rb b/lib/set.rb
index a19a4f3b5..e9c6931b1 100644
--- a/lib/set.rb
+++ b/lib/set.rb
@@ -418,14 +418,7 @@ class Set
def pretty_print(pp) # :nodoc:
pp.text sprintf('#<%s: {', self.class.name)
pp.nest(1) {
- first = true
- each { |o|
- if first
- first = false
- else
- pp.text ","
- pp.breakable
- end
+ pp.seplist(self) { |o|
pp.pp o
}
}