From: Anonymous Date: 2007-10-11T16:12:04+09:00 Subject: Why does this use a block So I'm new to Ruby and I'm trying to use OptionParser to parse in some command line arguments. I looked at some documentation on OptionParser and there is something that's confusing me to no end. In all the examples a block is being passed in to the constructor of the OptionParser object. The constructor simply makes a yield call, passing self as an argument. What is the point of this? Can we not convert opts = OptionParser.new() {|opts| body} To opts = OptionParser.new() body ? This seems more natural to me. But the former seems like a common Ruby idiom so I'm wondering what I am missing. Thanks, Jaimrk