Class: Sunspot::SessionProxy::DelayedJobSessionProxy
- Inherits:
-
AbstractSessionProxy
- Object
- AbstractSessionProxy
- Sunspot::SessionProxy::DelayedJobSessionProxy
- Defined in:
- lib/delayed_sunspot/sunspot/session_proxy/delayed_job_session_proxy.rb
Instance Attribute Summary collapse
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
- #batch(&block) ⇒ Object
- #commit ⇒ Object
- #commit_if_delete_dirty ⇒ Object
- #commit_if_dirty ⇒ Object
- #index(*objects) ⇒ Object
- #index!(*objects) ⇒ Object
-
#initialize(session) ⇒ DelayedJobSessionProxy
constructor
A new instance of DelayedJobSessionProxy.
- #remove(*objects, &block) ⇒ Object
- #remove!(*objects) ⇒ Object
- #remove_all(*classes) ⇒ Object
- #remove_all!(*classes) ⇒ Object
- #remove_by_id(clazz, id) ⇒ Object
- #remove_by_id!(clazz, id) ⇒ Object
Constructor Details
#initialize(session) ⇒ DelayedJobSessionProxy
Returns a new instance of DelayedJobSessionProxy.
10 11 12 |
# File 'lib/delayed_sunspot/sunspot/session_proxy/delayed_job_session_proxy.rb', line 10 def initialize(session) @session = session end |
Instance Attribute Details
#session ⇒ Object (readonly)
Returns the value of attribute session.
4 5 6 |
# File 'lib/delayed_sunspot/sunspot/session_proxy/delayed_job_session_proxy.rb', line 4 def session @session end |
Instance Method Details
#batch(&block) ⇒ Object
14 15 16 |
# File 'lib/delayed_sunspot/sunspot/session_proxy/delayed_job_session_proxy.rb', line 14 def batch(&block) enqueue(:batch, &block) end |
#commit ⇒ Object
18 19 20 |
# File 'lib/delayed_sunspot/sunspot/session_proxy/delayed_job_session_proxy.rb', line 18 def commit enqueue(:commit) end |
#commit_if_delete_dirty ⇒ Object
22 23 24 |
# File 'lib/delayed_sunspot/sunspot/session_proxy/delayed_job_session_proxy.rb', line 22 def commit_if_delete_dirty commit if @session.delete_dirty? end |
#commit_if_dirty ⇒ Object
26 27 28 |
# File 'lib/delayed_sunspot/sunspot/session_proxy/delayed_job_session_proxy.rb', line 26 def commit_if_dirty commit if @session.dirty? end |
#index(*objects) ⇒ Object
30 31 32 |
# File 'lib/delayed_sunspot/sunspot/session_proxy/delayed_job_session_proxy.rb', line 30 def index(*objects) enqueue(:index, *objects) end |
#index!(*objects) ⇒ Object
34 35 36 37 |
# File 'lib/delayed_sunspot/sunspot/session_proxy/delayed_job_session_proxy.rb', line 34 def index!(*objects) index(*objects) commit end |
#remove(*objects, &block) ⇒ Object
39 40 41 |
# File 'lib/delayed_sunspot/sunspot/session_proxy/delayed_job_session_proxy.rb', line 39 def remove(*objects, &block) enqueue(:remove, *objects, &block) end |
#remove!(*objects) ⇒ Object
43 44 45 46 |
# File 'lib/delayed_sunspot/sunspot/session_proxy/delayed_job_session_proxy.rb', line 43 def remove!(*objects) remove(*objects) commit end |
#remove_all(*classes) ⇒ Object
48 49 50 |
# File 'lib/delayed_sunspot/sunspot/session_proxy/delayed_job_session_proxy.rb', line 48 def remove_all(*classes) enqueue(:remove_all, *classes) end |
#remove_all!(*classes) ⇒ Object
52 53 54 55 |
# File 'lib/delayed_sunspot/sunspot/session_proxy/delayed_job_session_proxy.rb', line 52 def remove_all!(*classes) remove_all(*classes) commit end |
#remove_by_id(clazz, id) ⇒ Object
57 58 59 |
# File 'lib/delayed_sunspot/sunspot/session_proxy/delayed_job_session_proxy.rb', line 57 def remove_by_id(clazz, id) enqueue(:remove_by_id, clazz, id) end |
#remove_by_id!(clazz, id) ⇒ Object
61 62 63 64 |
# File 'lib/delayed_sunspot/sunspot/session_proxy/delayed_job_session_proxy.rb', line 61 def remove_by_id!(clazz, id) remove_by_id(clazz, id) commit end |