Module: Tmptation::InstanceTracking

Included in:
TmpDir, TmpFile
Defined in:
lib/tmptation.rb

Overview

Keep track of a class’s instances

Examples:


class Foo
  include InstanceTracking
end

a, b, c = Foo.new, Foo.new, Foo.new

[a,b,c] == Foo.instances #=> true

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



87
88
89
90
91
92
# File 'lib/tmptation.rb', line 87

def self.included(base)
  base.class_eval do
    extend  ClassMethods
    include InstanceMethods
  end
end