Module: TireAsyncIndex

Extended by:
TireAsyncIndex
Included in:
TireAsyncIndex
Defined in:
lib/tire_async_index.rb,
lib/tire_async_index/version.rb,
lib/tire_async_index/exceptions.rb,
lib/tire_async_index/configuration.rb,
lib/tire_async_index/workers/resque.rb,
lib/tire_async_index/workers/sidekiq.rb,
lib/tire_async_index/workers/update_index.rb

Defined Under Namespace

Modules: Workers Classes: Configuration, EngineNotFound

Constant Summary collapse

VERSION =
"0.3.0"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configurationObject

Returns the value of attribute configuration.



7
8
9
# File 'lib/tire_async_index.rb', line 7

def configuration
  @configuration
end

Instance Method Details

#configure {|configuration| ... } ⇒ Object

Yields:



9
10
11
12
# File 'lib/tire_async_index.rb', line 9

def configure
  self.configuration ||= Configuration.new
  yield(configuration)
end

#engineObject



18
19
20
# File 'lib/tire_async_index.rb', line 18

def engine
  self.configuration.engine
end

#queueObject



14
15
16
# File 'lib/tire_async_index.rb', line 14

def queue
  self.configuration.queue
end

#workerObject



22
23
24
25
26
27
28
29
30
31
# File 'lib/tire_async_index.rb', line 22

def worker
  case configuration.engine
  when :sidekiq
    TireAsyncIndex::Workers::Sidekiq
  when :resque
    TireAsyncIndex::Workers::Resque
  else
    TireAsyncIndex::Workers::UpdateIndex
  end
end