Class: DelayedSunspot::DelayedJob::SunspotJob

Inherits:
Object
  • Object
show all
Defined in:
lib/delayed_sunspot/delayed_job/sunspot_job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#methodObject (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

#proxyObject (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

#sessionObject (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

#performObject



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