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



24
25
26
# File 'lib/cequel/record/scoped.rb', line 24

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

#with_scope(record_set) ⇒ Object

Since:

  • 0.1.0



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

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