concept file operation in category ruby

appears as: file operations, file operations
The Well-Grounded Rubyist, Third Edition

This is an excerpt from Manning's book The Well-Grounded Rubyist, Third Edition.

Having looked a little at screen output, let’s widen the I/O field a bit to include keyboard input and file operations.

Ruby lets you economize on explicit closing of File objects—and enables you to keep your code nicely encapsulated—by providing a way to perform file operations inside a code block. We’ll look at this elegant and common technique next.