You misread this. There is no MD5.new call on that line, just
setting the variable t to the contents of the variable MD5, which is
identical to Digest::MD5. The rest of your explanation is
based on this
Oops being new to Ruby shows out here and Greg has pointed me in the
} You’ve asked the MD5 Class if it accepts the message/method
} class does not have this method but instances of objects
made with the
} class do. So you could have written.
} t = Digest::MD5 # create an instance of the MD5 class
Nononononono. That comment is incorrect. There is no instance creation
occurring on that line.
Again oops. The equivalent should have been
Digest::MD5.new(‘not quite so confused now’)
So based on Greg’s details I would think the equivalents would be:-
my_md5 = MD5.md5(‘clearer’)
my_md5 = Digest::MD5.new(‘clearer’)
/usr/lib/ruby/1.8/md5.rb aliases the class Digest::MD5 to MD5 and adds
the Class method MD5.md5 which is implemented as an alias to the
This is both patronizing and involves a certain amount of the
the kettle black. Yeesh.
Next time I’ll fire up IRB and check my results before posting. Thanks
for pointing out my errors and helping me learn.