Class Method
In: lib/methodsig.rb
lib/as_expression.rb
ext/nodewrap.c
Parent: Object
  rb_define_method(rb_cProc, "body", proc_body, 0);

ifndef RUBY_HAS_YARV

  rb_define_method(rb_cProc, "var", proc_var, 0);

endif

  rb_define_method(rb_cProc, "unbind", proc_unbind, 0);
  rb_define_method(rb_cProc, "<<", proc_push, 1);
  rb_define_method(rb_cProc, "push", proc_push, 1);
  rb_define_method(rb_cProc, "_dump", proc_dump, 1);
  rb_define_singleton_method(rb_cProc, "_load", proc_load, 1);

  rb_cUnboundProc = rb_define_class("UnboundProc", rb_cProc);
  rb_define_method(rb_cUnboundProc, "bind", unboundproc_bind, 1);
  rb_define_method(rb_cUnboundProc, "call", unboundproc_call, -2);
  rb_define_method(rb_cUnboundProc, "[]", unboundproc_call, -2);
  rb_define_method(rb_cUnboundProc, "binding", unboundproc_binding, 0);

  rb_mMarshal = rb_const_get(rb_cObject, rb_intern("Marshal"));

Methods

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 Class it is attached to.

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.

Given a Method, returns the Object to which it is bound.

Return a String representing the method‘s signature.

[Validate]