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.
55 56 57 58 59 60 61 |
# File 'lib/instance_tracker/trackable.rb', line 55 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
65 66 67 |
# File 'lib/instance_tracker/trackable.rb', line 65 def trackable_instance trackable.instance end |