Module: Cequel::Record::Scoped::ClassMethods

Extended by:
Forwardable
Defined in:
lib/cequel/record/scoped.rb

Overview

Scoping-related methods for Cequel::Record classes

Since:

  • 0.1.0

Instance Method Summary collapse

Instance Method Details

#current_scopeObject

Since:

  • 0.1.0



26
27
28
# File 'lib/cequel/record/scoped.rb', line 26

def current_scope
  delegating_scope || RecordSet.new(self)
end

#with_scope(record_set) ⇒ Object

Since:

  • 0.1.0



31
32
33
34
35
36
37
# File 'lib/cequel/record/scoped.rb', line 31

def with_scope(record_set)
  previous_scope = delegating_scope
  self.delegating_scope = record_set
  yield
ensure
  self.delegating_scope = previous_scope
end