undefine a method with undef. : undef « Method « Ruby






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

 








Related examples in the same category