aboutsummaryrefslogtreecommitdiffstats
path: root/lib/roo/base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/roo/base.rb')
-rw-r--r--lib/roo/base.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/roo/base.rb b/lib/roo/base.rb
index 91c8d1c..80b495e 100644
--- a/lib/roo/base.rb
+++ b/lib/roo/base.rb
@@ -250,10 +250,10 @@ class Roo::Base
# iterate through all worksheets of a document
def each_with_pagename
- Enumerator.new do |yielder|
- sheets.each do |s|
- yielder << sheet(s, true)
- end
+ return to_enum(:each_with_pagename) { sheets.size } unless block_given?
+
+ sheets.each do |s|
+ yield sheet(s, true)
end
end