On Jan 20, 2007, at 1:38 PM, dblack / wobblini.net wrote:
> I'm not quite understanding the idea of meth.receiver, though.  How
> does that fit in with the idea of the receiver being whatever object a
> given message is sent to (which could, in most cases, be any of many
> objects)?

We are talking about the information encapsulated in an instance
of Method, which currently isn't accessible via introspection (unless
you want to get creative and parse the output of the inspect string).

a = [1,2]
m1 = a.method('first')

m1.receiver	# a, i.e. [1, 2]
m1.name		# :first
m1.origin	# Array

um1 = um1.unbind
um1.receiver	# NameError, no such method
um.name		# :first
um.origin	# Array

m2 = um.bind( [3,4] )
m2.receiver	# [3,4]
m2.name		# :first
m2.origin	# Array

owning_class and defining_class have also been suggest instead of
origin.

I would suggest that owning_module and defining_module would be
more accurate though since classes are modules but modules are not
classes.

Gary Wright