Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6affa26d97
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (25 sloc) 0.422 kb
# Execute Around Method
# This one is a core Ruby idiom.
# File os opened and closed around the block.
open('myfile') do |f|
# ... do something with the file ...
end
# Cursor example:
class Cursor
def show_while
old = Cursor.current_cursor
show
yield
old.show
end
end
# With ensure:
class Cursor
def show_while
old = Cursor.current_cursor
show
yield
ensure
old.show
end
end
Jump to Line
Something went wrong with that request. Please try again.