Here are few methods that we can use for debugging:
shows you where you have been.
It will give you “file:line in method”
It is a class.
m = "Hello World".method(:upcase)
m.class => Method
m.call => "HELLO WORLD"
It will give address and line number. It shows you where you are going.
It will give you address with line number of this above(:bark) method.
"foo".class.ancestors => [String, Comparable, Object, Kernal, BasicObject]
In class method you can simply call it like:
"foo".class.method_defined?(:upcase) => true
99.class.method_defined?(:upcase) => false
you can use:
here we don’t need to create instance.