naught
naught copied to clipboard
Add __callstack__ to return methods calls
I wanted to be able to do something like this
Locals = Naught.build do |c|
c.black_hole
def to_s
__callstack__.join('.')
end
end
Updated to record method call arguments
I'd be willing to merge something like this, but I have some notes I'd want to see addressed first:
-
this could blow up memory use in non-obvious ways. I'd like it to only be in effect when explicitly requested. It might make sense to integrate this with the
traceablesetting. -
What happens when I use a null object more than once? Will the resulting trace concatenate the two uses as if they were one long call chain? E.g.:
my_null.foo.bar my_null.baz.buz -
It would be nice if the returned trace(s) contained objects that were roughly similar to
Thread::Backtrace::Location -
It may make sense to share some implementation with the
pebblecode.