Class: TireAsyncIndex::Configuration
- Inherits:
-
Object
- Object
- TireAsyncIndex::Configuration
- Defined in:
- lib/tire_async_index/configuration.rb
Constant Summary collapse
- AVALAIBLE_ENGINE =
[:sidekiq, :resque, :none]
Instance Attribute Summary collapse
-
#engine ⇒ Object
Returns the value of attribute engine.
-
#queue ⇒ Object
Returns the value of attribute queue.
Instance Method Summary collapse
- #background_engine(type) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #use_queue(name) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
20 21 22 23 |
# File 'lib/tire_async_index/configuration.rb', line 20 def initialize @queue = :normal @engine = :none end |
Instance Attribute Details
#engine ⇒ Object
Returns the value of attribute engine.
6 7 8 |
# File 'lib/tire_async_index/configuration.rb', line 6 def engine @engine end |
#queue ⇒ Object
Returns the value of attribute queue.
5 6 7 |
# File 'lib/tire_async_index/configuration.rb', line 5 def queue @queue end |
Instance Method Details
#background_engine(type) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/tire_async_index/configuration.rb', line 8 def background_engine type if AVALAIBLE_ENGINE.include?(type.to_sym) @engine = type.to_sym else raise EngineNotFound, "Background Engine '#{type}' not found" end end |
#use_queue(name) ⇒ Object
16 17 18 |
# File 'lib/tire_async_index/configuration.rb', line 16 def use_queue name @queue = name.to_sym end |