📁 File Manager Pro
v10.0.3 | PHP: 8.1.34
Server: Apache
2026-06-22 05:10:31
📂
/ (Root)
/
opt
/
alt
/
ruby27
/
share
/
ri
/
system
/
UnboundMethod
📍 /opt/alt/ruby27/share/ri/system/UnboundMethod
🔄 Refresh
✏️
Editing: cdesc-UnboundMethod.ri
Read Only
U:RDoc::NormalClass[iI"UnboundMethod:ET@I"Object;To:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[ I"ERuby supports two forms of objectified methods. Class Method is ;TI"Eused to represent methods that are associated with a particular ;TI"Bobject: these method objects are bound to that object. Bound ;TI"Emethod objects for an object can be created using Object#method.;To:RDoc::Markup::BlankLine o; ;[ I"FRuby also supports unbound methods; methods objects that are not ;TI"Fassociated with a particular object. These can be created either ;TI"Hby calling Module#instance_method or by calling #unbind on a bound ;TI"Dmethod object. The result of both of these is an UnboundMethod ;TI"object.;T@o; ;[I"CUnbound methods can only be called after they are bound to an ;TI"Bobject. That object must be a kind_of? the method's original ;TI"class.;T@o:RDoc::Markup::Verbatim;[I"class Square ;TI" def area ;TI" @side * @side ;TI" end ;TI" def initialize(side) ;TI" @side = side ;TI" end ;TI" end ;TI" ;TI"-area_un = Square.instance_method(:area) ;TI" ;TI"s = Square.new(12) ;TI"area = area_un.bind(s) ;TI"area.call #=> 144 ;T:@format0o; ;[I"FUnbound methods are a reference to the method at the time it was ;TI"Fobjectified: subsequent changes to the underlying class will not ;TI"affect the unbound method.;T@o;;[I"class Test ;TI" def test ;TI" :original ;TI" end ;TI" end ;TI"&um = Test.instance_method(:test) ;TI"class Test ;TI" def test ;TI" :modified ;TI" end ;TI" end ;TI"t = Test.new ;TI"%t.test #=> :modified ;TI"$um.bind(t).call #=> :original;T;0: @fileI"proc.c;T:0@omit_headings_from_table_of_contents_below0; 0;0[ [ [ [[I" class;T[[:public[ [:protected[ [:private[ [I" instance;T[[;[ [;[ [;[[I"==;TI"proc.c;T[I" arity;T@^[I" bind;T@^[I"bind_call;T@^[I" clone;T@^[I" eql?;T@^[I" hash;T@^[I"inspect;T@^[I" name;T@^[I"original_name;T@^[I" owner;T@^[I"parameters;T@^[I"source_location;T@^[I"super_method;T@^[I" to_s;T@^[ [U:RDoc::Context::Section[i 0o;;[ ; 0;0[I"proc.c;T@EcRDoc::TopLevel
💾 Save Changes
❌ Cancel