Skip to content

Commit

Permalink
updating to latest blankslate from builder
Browse files Browse the repository at this point in the history
  • Loading branch information
JackDanger committed Nov 2, 2009
1 parent 5489430 commit d793cc6
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/blankslate.rb
Expand Up @@ -36,13 +36,9 @@ def find_hidden_method(name)
# Redefine a previously hidden method so that it may be called on a blank
# slate object.
def reveal(name)
bound_method = nil
unbound_method = find_hidden_method(name)
fail "Don't know how to reveal method '#{name}'" unless unbound_method
define_method(name) do |*args|
bound_method ||= unbound_method.bind(self)
bound_method.call(*args)
end
hidden_method = find_hidden_method(name)
fail "Don't know how to reveal method '#{name}'" unless hidden_method
define_method(name, hidden_method)
end
end

Expand Down

0 comments on commit d793cc6

Please sign in to comment.