Permalink
Browse files

Improved object_instance.unextend

  • Loading branch information...
1 parent e3b6d17 commit a729826c49f6e8515d747694f74f04359c04e449 Paul Engel committed May 1, 2011
Showing with 6 additions and 2 deletions.
  1. +4 −0 CHANGELOG.rdoc
  2. +2 −2 lib/unextendable/object.rb
View
@@ -1,5 +1,9 @@
= Unextendable CHANGELOG
+== Version 0.1.2 (May xx, 2011)
+
+* Improved object_instance.unextend
+
== Version 0.1.1 (May 1, 2011)
* Being able to pass a block to 'unextend' and only unextending a module when the block passes
@@ -29,11 +29,11 @@ def extend(*modules)
def unextend(*modules, &block)
if modules.empty?
meta_class.extended_modules.delete_if do |mod|
- mod.unextendable? if !block_given? || block.call(mod)
+ mod.unextendable? && (!block_given? || block.call(mod))
end
else
modules.each do |mod|
- meta_class.extended_modules.delete mod if !block_given? || block.call(mod)
+ meta_class.extended_modules.delete mod if mod.unextendable? && (!block_given? || block.call(mod))
end
end
end

0 comments on commit a729826

Please sign in to comment.