Ruby/Method/undef

Материал из Wiki.crossplatform.ru

(Различия между версиями)
Перейти к: навигация, поиск

Версия 17:10, 26 мая 2010

undefine a method with undef.

def hello
  puts "Hello, Matz!"
end
hello # => Hello, Matz!
 
undef hello # undefines the method named hello
hello # try calling this method now