Permalink
Browse files

Corrected the arguments definition of instance.respond_to? (being abl…

…e to pass include_private)
  • Loading branch information...
Paul Engel
Paul Engel committed May 2, 2011
1 parent ae7c9e7 commit 59d0c6fc4d46de7f05cbbba96837118372848aec
Showing with 4 additions and 3 deletions.
  1. +1 −0 CHANGELOG.rdoc
  2. +3 −3 lib/unextendable/object.rb
View
@@ -3,6 +3,7 @@
== Version 0.1.3 (May 2, 2011)
* Always returning boolean when calling object.meta_class?
+* Corrected the arguments definition of instance.respond_to? (being able to pass include_private)
== Version 0.1.2 (May 2, 2011)
@@ -43,11 +43,11 @@ def unextend(*modules, &block)
end
end
- def respond_to?(method_name)
+ def respond_to?(symbol, include_private = false)
if meta_class? && meta_class.extended_modules.any?{|mod| mod.unextendable?}
- meta_class.extended_modules.detect{|x| x.instance_methods.include? method_name.to_s} || meta_class.method_procs[method_name.to_s].class == Proc
+ meta_class.extended_modules.detect{|x| x.instance_methods.include? symbol.to_s} || meta_class.method_procs[symbol.to_s].class == Proc
else
- !(meta_class? && meta_class.method_procs.key?(method_name.to_s) && meta_class.method_procs[method_name.to_s].nil?) && super
+ !(meta_class? && meta_class.method_procs.key?(symbol.to_s) && meta_class.method_procs[symbol.to_s].nil?) && super
end
end

0 comments on commit 59d0c6f

Please sign in to comment.