Suppose I have the global method hello(name) and an instance method hello like this:
def hello(name)
puts("Hello " + name)
end
class String
def hello
hello(self) # does not work, see below
end
end
I want to be able to say
"world".hello()
but ruby won’t let me. It complains
in `hello': wrong number of arguments (1 for 0) (ArgumentError)
What am I missing?
This should work