Class: Sunspot::SessionProxy::DelayedJob::IndexingJob
- Inherits:
-
Object
- Object
- Sunspot::SessionProxy::DelayedJob::IndexingJob
- Defined in:
- lib/sunspot_plus/session_proxy/delayed_job/indexing_job.rb
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#proxy ⇒ Object
readonly
Returns the value of attribute proxy.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
-
#initialize(proxy, method, *args, &block) ⇒ IndexingJob
constructor
A new instance of IndexingJob.
- #perform ⇒ Object
- #rebuild_config ⇒ Object
Constructor Details
#initialize(proxy, method, *args, &block) ⇒ IndexingJob
Returns a new instance of IndexingJob.
13 14 15 16 17 18 |
# File 'lib/sunspot_plus/session_proxy/delayed_job/indexing_job.rb', line 13 def initialize(proxy, method, *args, &block) @session = proxy.session @proxy = proxy @method = method @args = args end |
Instance Attribute Details
#method ⇒ Object (readonly)
Returns the value of attribute method.
11 12 13 |
# File 'lib/sunspot_plus/session_proxy/delayed_job/indexing_job.rb', line 11 def method @method end |
#proxy ⇒ Object (readonly)
Returns the value of attribute proxy.
11 12 13 |
# File 'lib/sunspot_plus/session_proxy/delayed_job/indexing_job.rb', line 11 def proxy @proxy end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
11 12 13 |
# File 'lib/sunspot_plus/session_proxy/delayed_job/indexing_job.rb', line 11 def session @session end |
Instance Method Details
#perform ⇒ Object
24 25 26 27 28 29 |
# File 'lib/sunspot_plus/session_proxy/delayed_job/indexing_job.rb', line 24 def perform # Delayed job serializes ruby objects to yaml. # Yaml doesn't rebuild the LightConfiguration object correctly so we need to brute force a rebuild of the configuration rebuild_config @args ? @session.send(method, *@args) : @session.send(method) end |
#rebuild_config ⇒ Object
20 21 22 |
# File 'lib/sunspot_plus/session_proxy/delayed_job/indexing_job.rb', line 20 def rebuild_config @session.instance_variable_set("@config", proxy.class.rebuild_config(session.config)) end |