Permalink
Browse files

Added RDoc documentation within core_ext/object.rb

  • Loading branch information...
Paul Engel
Paul Engel committed Jun 11, 2012
1 parent 6be04ec commit 4b674b507acf167d5e2e0b488352a9809ebbfb31
Showing with 13 additions and 0 deletions.
  1. +13 −0 lib/core_ext/object.rb
View
@@ -1,25 +1,38 @@
class Object
+ # A convenience method for detaching all class instances with detach
+ #
def self.detach_all
Mass.index(self.class)[self.class.name].each{|object_id| Mass[object_id].detach}
end
+ # A convenience method for detaching all class instances with detach!
+ #
def self.detach_all!
Mass.index(self.class)[self.class.name].each{|object_id| Mass[object_id].detach!}
end
+ # Mass uses this method to derive object references. Override this method for increasing performance.
+ # In order to override this method, you would probably want to use <tt>Mass.references</tt> of a sample instance.
+ #
def _reference_instances(*mods)
Mass.send(:instances_within, *mods)
end
+ # A convenience method for Mass.references
+ #
def references(*mods)
Mass.references(self, *mods)
end
+ # A convenience method for Mass.detach
+ #
def detach(*mods, &block)
Mass.detach(self, *mods, &block)
end
+ # A convenience method for Mass.detach!
+ #
def detach!(*mods, &block)
Mass.detach!(self, *mods, &block)
end

0 comments on commit 4b674b5

Please sign in to comment.