lib/bogus/copies_classes.rb in bogus-0.1.0 vs lib/bogus/copies_classes.rb in bogus-0.1.1
- old
+ new
@@ -3,11 +3,14 @@
extend Takes
takes :copies_methods
def copy(klass)
- copy_class = Class.new(Bogus::Fake)
- copy_class.__copied_class__ = klass
+ copy_class = Class.new(Bogus::Fake) do
+ define_singleton_method(:__copied_class__) do
+ klass
+ end
+ end
copies_methods.copy(klass, copy_class)
copy_class
end
end
end