Module: InstanceTracker::Trackable::InstanceMethods
- Defined in:
- lib/instance_tracker/trackable.rb
Instance Method Summary collapse
-
#trackable ⇒ CleanRoom
private
The instance of CleanRoom is memoised and returned accordingly.
-
#trackable_instance ⇒ Object
Returns the instance tracked by CleanRoom.
Instance Method Details
#trackable ⇒ CleanRoom
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The instance of CleanRoom is memoised and returned accordingly.
39 40 41 42 43 44 45 |
# File 'lib/instance_tracker/trackable.rb', line 39 def trackable @trackable ||= begin entity = instance_variable_get(:"@#{singleton_class.trackable_instance}") raise NotImplementedError unless entity Class.new(CleanRoom).new(entity) end end |
#trackable_instance ⇒ Object
Returns the instance tracked by CleanRoom
49 50 51 |
# File 'lib/instance_tracker/trackable.rb', line 49 def trackable_instance trackable.instance end |