Module: InstanceTracker::Trackable::ClassMethods

Defined in:
lib/instance_tracker/trackable.rb

Instance Method Summary collapse

Instance Method Details

#track(name) ⇒ Object

Sets the instance variable to be tracked.

Parameters:

  • name (String)

    the instance variable to track



61
62
63
64
65
66
67
# File 'lib/instance_tracker/trackable.rb', line 61

def track(name)
  singleton_class.class_eval do
    define_method :trackable_instance do
      name
    end
  end
end