H
Hartin, Brian
For certain methods, it seems to behave differently if called via
reflection. Consider the following example:
class Foo
=20 def method_missing(method, *args, &block)
=20 "#{method} called"
=20 end
end
f =3D Foo.new
f.bar('a')
-> "bar called"
f.sendbar, 'a')
-> "bar called"
f.open('a')
-> "open called"
f.sendopen, 'a')
Errno::ENOENT: No such file or directory - a
=20 from (irb):8:in `initialize'
=20 from (irb):8
=20 =20
----
I know that 'open' is a Kernel method, but I would have expected
f.open('a') and f.sendopen, 'a') to behave similarly - either call the
Kernel method or call method_missing. Does anyone know why they're
different?
Thanks,
Brian Hartin
*************************************************************************=
***=20
This email may contain confidential material.=20
If you were not an intended recipient,=20
Please notify the sender and delete all copies.=20
We may monitor email to and from our network.=20
*************************************************************************=
***
reflection. Consider the following example:
class Foo
=20 def method_missing(method, *args, &block)
=20 "#{method} called"
=20 end
end
f =3D Foo.new
f.bar('a')
-> "bar called"
f.sendbar, 'a')
-> "bar called"
f.open('a')
-> "open called"
f.sendopen, 'a')
Errno::ENOENT: No such file or directory - a
=20 from (irb):8:in `initialize'
=20 from (irb):8
=20 =20
----
I know that 'open' is a Kernel method, but I would have expected
f.open('a') and f.sendopen, 'a') to behave similarly - either call the
Kernel method or call method_missing. Does anyone know why they're
different?
Thanks,
Brian Hartin
*************************************************************************=
***=20
This email may contain confidential material.=20
If you were not an intended recipient,=20
Please notify the sender and delete all copies.=20
We may monitor email to and from our network.=20
*************************************************************************=
***