Skip to content

Commit

Permalink
suppress warning while undefining object_id
Browse files Browse the repository at this point in the history
  • Loading branch information
jimweirich committed Sep 9, 2012
1 parent 05ab195 commit baba998
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/blankslate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,16 @@ class << self
# Hide the method named +name+ in the BlankSlate class. Don't
# hide +instance_eval+ or any method beginning with "__".
def hide(name)
if instance_methods.include?(name._blankslate_as_name) and
name !~ /^(__|instance_eval$)/
warn_level = $VERBOSE
$VERBOSE = nil
if instance_methods.include?(name._blankslate_as_name) &&
name !~ /^(__|instance_eval$)/
@hidden_methods ||= {}
@hidden_methods[name.to_sym] = instance_method(name)
undef_method name
end
ensure
$VERBOSE = warn_level
end

def find_hidden_method(name)
Expand Down

0 comments on commit baba998

Please sign in to comment.