Module: Superstore::Scoping::ClassMethods

Defined in:
lib/superstore/scoping.rb

Instance Method Summary collapse

Instance Method Details

#current_scopeObject



21
22
23
# File 'lib/superstore/scoping.rb', line 21

def current_scope
  Thread.current["#{self}_current_scope"]
end

#current_scope=(new_scope) ⇒ Object



25
26
27
# File 'lib/superstore/scoping.rb', line 25

def current_scope=(new_scope)
  Thread.current["#{self}_current_scope"] = new_scope
end

#scopeObject



17
18
19
# File 'lib/superstore/scoping.rb', line 17

def scope
  self.current_scope ||= Scope.new(self)
end