Class UnboundMethod
In: lib/methodsig.rb
lib/as_expression.rb
ext/nodewrap.c
Parent: Object

if RUBY_VERSION_CODE < 185

  rb_cMethod = rb_const_get(rb_cObject, rb_intern("Method"));

endif

  rb_define_method(rb_cMethod, "receiver", method_receiver, 0);

Methods

_dump   _load   body   method_id   method_oid   origin_class   signature  

Included Modules

MethodSig MethodAsExpression

Public Class methods

Public Instance methods

Dump a Method and the object to which it is bound to a String. The Method‘s class will not be dumped, only the name of the class.

Unfortunately, this means that methods for anonymous classes can be dumped but cannot be loaded.

Given a Method, returns the Node for that Method‘s body. This can be used to directly copy one class‘s method to another (using add_method).

Given a Method, returns the Symbol of the method it represents. If the method is an alias for another method, returns the Symbol of the new method, not the original. If the method changes name, returns the original name, not the new name.

Given a Method, returns the Symbol of the method it represents. If the method is an alias for another method, returns the Symbol of the original method, not the alias. If the original method changes name, returns the original name.

Given a Method, returns the Class in which the method it represents was defined. If the method was defined in a base class and Object#method is called on a derived instance of that base class, this method returns the base class.

Return a String representing the method‘s signature.

[Validate]