Материал из Wiki.crossplatform.ru
(Различия между версиями)
Версия 17:10, 26 мая 2010
Extends File class and add new method
class MyFile < File
def MyFile.ftype(*args)
return "The type is #{super}."
end
end
File.ftype("/bin") # => "directory"
puts MyFile.ftype("/bin") # => "The type is directory."