Class: Method

Inherits:
Object
  • Object
show all
Defined in:
lib/lspace/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#in_lspaceProc

Preserve LSpace when this method is run. Returns a new Proc, a closure that re-enters the current LSpace when it is called.

Examples:

def fire
  LSpace[:user_id]
end

todo = method(:fire!).in_lspace
todo.call == 2

Returns:

  • (Proc)

    A version of self that re-enters LSpace before running

See Also:



97
98
99
# File 'lib/lspace/core_ext.rb', line 97

def in_lspace
  LSpace.preserve(&self)
end