From: Jason Roelofs Date: 2006-10-24T05:24:29+09:00 Subject: Re: File::open and File.open ------=_Part_116734_32659365.1161635065791 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline This is just Ruby syntax. It allows both :: and . as operators to class-level methods and variables. File::open and File.open are the exact same thing: a class method. Were it an instance method, you would have to do: file = File.new file.open aka, create an instance of the object, then call the function. For confusions sake, this is the same as: file = File::new file.open Jason On 10/23/06, Brad Tilley wrote: > > What exactly is the difference between these? :: is a class method while > . is an instance method??? If that is so, could someone clarify this > with more detail? I use File.open, but File::open works too. However > sometimes, this is not the case which adds to my confusion :) For > example, I can only do Digest::MD5.new() and not Digest.MD5.new() why is > that? > > I don't fully understand OO programming... perhaps this is my problem. > > Thank you for your time. > > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_116734_32659365.1161635065791--