Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8918997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:54:04+00:00 2026-06-15T05:54:04+00:00

Take class A; def foo; end; end class B < A; end b =

  • 0

Take

class A; def foo; end; end
class B < A; end
b = B.new          # => #<B:0x0000000243b8c0>
m = b.method :foo  # => #<Method: B(A)#foo>
m.owner            # => A
m.receiver         # => #<B:0x0000000243b8c0>
m.receiver.class   # => B
mm = m.unbind      # => #<UnboundMethod: B(A)#foo>

How can I get B from mm short of parsing the result of mm.to_s?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T05:54:05+00:00Added an answer on June 15, 2026 at 5:54 am

    I spent some time looking at proc.c and I don’t think it is possible. B gets stored in rclass and as far as I can tell it is not accessible anywhere. You can see how it is used here, although I don’t think that helps either.

    May I ask why do you need to do that? Maybe there is another way to solve the general problem 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When inheriting from two objects like these class Foo(object): def __init__(self,a): self.a=a class Bar(object):
Scriptaculous's Effect.Morph can take a CSS class and apply it over a period of
take this simple code: class A{ public: virtual void foo() = 0; void x(){
Take the following class: class Automator def fill_specific_form(fields) fields.each_pair do |key, value| puts Setting
I have an Accessor class that retrieves Items. It can also take an Item
If you have the following class: class Foo(object): def __init__(name): self.name = name And
Given: case class Foo(a: Int, b: String, c: Double) you can say: val params
I'm Java person who just started learning Python. Take this example: class Person(): def
I want to take person's name and their phone number from the end user
This one's been keeping me up at night for a while. class Foo def

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.