End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method · added in Ruby 3.1
UnboundMethod#protected?
meth.protected? → true or false
proc.c
View on GitHub ↗
static VALUE
method_protected_p(VALUE method)
{
const struct METHOD *data;
TypedData_Get_Struct(method, struct METHOD, &method_data_type, data);
return RBOOL(METHOD_ENTRY_VISI(data->me) == METHOD_VISI_PROTECTED);
}
Returns whether the method is protected.
Ruby version changes
- 3.1