I'm just learning Ruby, so please forgive any naivete revealed here.
In the following code,
#---------------------------------------
class DummyClass
  include FileTest
end
DummyInstance = DummyClass.new
#This works
puts FileTest.exists?("c:\\autoexec.bat")
#This doesn't work
puts DummyInstance.exists?("c:\\autoexec.bat")
#---------------------------------------
it seems like the FileTest module acts more like a class than a
module. From what I've read, modules can be used as "mixins" to
enhance existing classes but cannot be instantiated on their own.
However, the opposite seems to be occurring.
If I substitute the FileTest module for my own module, the expected
behavior occurs:
#---------------------------------------
module SampleModule
 def displayMessage
  return "Hello World!"
 end
end
class DummyClass2
  include SampleModule
end
DummyInstance2 = DummyClass2.new
#This works
puts DummyInstance2.displayMessage
#This doesn't work
puts SampleModule.displayMessage
#---------------------------------------
Am I using the FileTest module incorrectly? And if FileTest can be
used as a standalone object (instead of being mixed in), why isn't it
a class instead of a module? I know there's the File::Stat object, but
it seems to operate a bit differently than FileTest.