Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
UnboundMethod#original_name
() -> ::Symbol
meth.original_name → symbol
proc.c
View on GitHub ↗
static VALUE
method_original_name(VALUE obj)
{
struct METHOD *data;
TypedData_Get_Struct(obj, struct METHOD, &method_data_type, data);
return ID2SYM(data->me->def->original_id);
}
Returns the original name of the method.
Example
class C def foo; end alias bar foo end C.instance_method(:bar).original_name # => :foo