2

I have a method definition like this:

def m1(a:Int, b:String, c:Val) end m = method(:m1) 

Note that Int, String, Val are default values for a, b, c.

Is it possible to get this information from the method object m?

2

1 Answer 1

1

No, this is not possible. It has been discussed numerous times on the ruby-core mailinglist, but it's simply not feasible. What should your proposed method return for something like this:

def m(p: if rand < 0.5 then Time.now else ENV['HOME'] end) end 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.