From: Timothy Goddard Date: 2006-03-08T20:08:41+09:00 Subject: Re: Having a block executed in the context of an instance In my opinion, this is unneccesary and still a bit confusing unless the object has a limited lifetime (as in the case of IO resources) or will change state when the block is ended. You could use: button = Button.new button.caption = 'Click Me' Blocks are good for DSLs or management of _limited_ resources. It is a bad idea to use the new method to provide a limited resource as this will impair forward-compatability. A different method should be used (and new possibly made private) to enable future change. For button management I would use something along the lines of the DSL outlined above but would use additional blocks in the same scope to handle events. button = Button.new do caption "Click Me" # Public method, button.caption and button.caption= useable from outside on_click do caption "You Clicked Me!" # Can update attributes in response to events with very little extra work. end end