Skip to content

Instantly share code, notes, and snippets.

@nahi
Created October 15, 2012 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nahi/3896042 to your computer and use it in GitHub Desktop.
Save nahi/3896042 to your computer and use it in GitHub Desktop.
class Node
def eval(other)
other.protected_method(self)
end
protected
def protected_method(other)
other
end
end
class NodeFake
def initialize(node)
@node = node
end
def eval(other)
p :pre
p self == other.protected_method(self)
p :post
end
end
NodeFake.new(Node.new).eval(Node.new)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment