The open-uri module simply redefines the Kernel.open method. You can
do it yourself:
alias original_open open
def open( blah, *blah_params, &blah_block)
original_open( blah, *blah_params, &blah_block)
Above, we store the original "open" method in original_open; then we
redefine open, calling the original open function if necessary.
On 8/19/05, Scott <firstname.lastname@example.org> wrote:
I am new ruby usrs (and loving it) and have a question.
By "requiring" opne-uri into my source file I can now reference "http"
addresses as they were local files. It seems that open-uri "hooks"
into the Kernel.open method.
I am just wondering what aspect of the ruby language allows you to do
this. Or is there some mechanism inside of the Kernel that allows you
to register a different protocol?
thanks in advance, scott.
Mohit Muthanna [mohit (at) muthanna (uhuh) com]
"There are 10 types of people. Those who understand binary, and those