如何在Ruby中调用URI模块

问题描述:

如何设计一个与URI模块类似的模块?我的意思是这样的:如何在Ruby中调用URI模块

1.9.3-p125 :001 > require 'uri' 
=> true 
1.9.3-p125 :002 > URI.class 
=> Module 
1.9.3-p125 :003 > URI("http://google.com") 
=> #<URI::HTTP:0x0000010d8f6bd8 URL:http://google.com> 

这是可能的具有相同名称的方法和类/模块:

1.8.7 > class Foo; end 
=> nil 
1.8.7 > def Foo; 42; end 
=> nil 
1.8.7 > Foo 
=> Foo 
1.8.7 > Foo() 
=> 42