Get the name of the currently executing method
$0 is the variable for the top level Ruby program, but is there one for the current method? 5 Answers 5
$0 is the variable for the top level Ruby program, but is there one for the current method? 5 Answers 5
Do you know if there is a built-in function to build a dictionary from an arbitrary object? I’d like to do something like this: >>> class Foo: … bar=”hello” … baz = ‘world’ … >>> f = Foo() >>> props(f) { ‘bar’ : ‘hello’, ‘baz’ : ‘world’ } NOTE: It should not include methods. Only … Read more