Module: CurrentObject::ClassMethods

Defined in:
lib/current_object.rb

Instance Method Summary collapse

Instance Method Details

#currentObject

current - Returns the instance of the class that is stored as the “current” instance.

@foo.current!

Foo.current # => @foo



26
27
28
# File 'lib/current_object.rb', line 26

def current
  Thread.current[self.name]
end