I have code like this:
context = area.window.create_cairo_context
context.set_source_rgb(0, 0, 0)
context.set_line_width(0.5)
context.arc(x + width - radius, y + radius, radius, -90 * degrees, 0 * degrees)
context.arc(x + width - radius, y + height - radius, radius, 0 * degrees, 90 * degrees)
context.arc(x + radius, y + height - radius, radius, 90 * degrees, 180 * degrees)
context.arc(x + radius, y + radius, radius, 180 * degrees, 270 * degrees)
context.close_path
context.stroke_preserve
context.set_source_rgb(0.7, 1.0, 1.0)
context.fill
Notice that I'm calling methods on the same object over and over again. Is there someway that Ruby will let me change the current object (self) to context so I can just keep calling these methods with no explicit receiver until I change scope?
Or, to put it simply: There must be some way to not have to type context over and over again!