Class: DelayedSunspot::DelayedJob::SunspotJob
- Inherits:
-
Object
- Object
- DelayedSunspot::DelayedJob::SunspotJob
- Defined in:
- lib/delayed_sunspot/delayed_job/sunspot_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) ⇒ SunspotJob
constructor
A new instance of SunspotJob.
- #perform ⇒ Object
Constructor Details
#initialize(proxy, method, *args, &block) ⇒ SunspotJob
Returns a new instance of SunspotJob.
6 7 8 9 10 11 |
# File 'lib/delayed_sunspot/delayed_job/sunspot_job.rb', line 6 def initialize(proxy, method, *args, &block) @proxy = proxy @session = proxy.session @method = method @args = args end |
Instance Attribute Details
#method ⇒ Object (readonly)
Returns the value of attribute method.
4 5 6 |
# File 'lib/delayed_sunspot/delayed_job/sunspot_job.rb', line 4 def method @method end |
#proxy ⇒ Object (readonly)
Returns the value of attribute proxy.
4 5 6 |
# File 'lib/delayed_sunspot/delayed_job/sunspot_job.rb', line 4 def proxy @proxy end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
4 5 6 |
# File 'lib/delayed_sunspot/delayed_job/sunspot_job.rb', line 4 def session @session end |
Instance Method Details
#perform ⇒ Object
13 14 15 16 |
# File 'lib/delayed_sunspot/delayed_job/sunspot_job.rb', line 13 def perform rebuild_config @args ? @session.send(method, *@args) : @session.send(method) end |