Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make block format possible for workbook.close #31

Open
ghost opened this issue Dec 15, 2013 · 0 comments
Open

Make block format possible for workbook.close #31

ghost opened this issue Dec 15, 2013 · 0 comments

Comments

@ghost
Copy link

ghost commented Dec 15, 2013

Hi.

workbook = WriteExcel.new('ruby.xls') # Step 1
worksheet = workbook.add_worksheet # Step 2
worksheet.write('A1', 'Hi Excel!') # Step 3
workbook.close

I believe the .close could be eliminated, just as
it is possible in

File.open() {

}

Simply use a block style, like so:

WriteExcel.new('ruby.xls') { # Step 1
worksheet = add_worksheet # Step 2
worksheet.write('A1', 'Hi Excel!') # Step 3
}

artembaikuzin added a commit to artembaikuzin/writeexcel that referenced this issue Feb 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants