Last Modified
2013-01-08 15:53:44 +0000
Requires

Description

An inspecting delegator.

Create a trap passing in any object of your choice.

Any time a method is called on the trap, it prints the method name, all its args, and the direct caller.

@example Did you know how basic operators work? Now you do!

trapped_int = ItsATrap.new(3)

trapped_int - 55
[:-, [55], nil, "..."]
=> -52

55 - trapped_int
[:coerce, [55], nil, "..."]
=> 52

- trapped_int
[:-@, [], nil, "..."]
=> -3