Class: Totoro::Config
- Inherits:
-
Object
- Object
- Totoro::Config
- Defined in:
- lib/totoro/config.rb
Class Method Summary collapse
- .connect ⇒ Object
- .data ⇒ Object
- .get_worker(worker_class) ⇒ Object
- .queue(id) ⇒ Object
- .reset_data ⇒ Object
Class Method Details
.connect ⇒ Object
12 13 14 |
# File 'lib/totoro/config.rb', line 12 def connect data[:connect] end |
.data ⇒ Object
4 5 6 |
# File 'lib/totoro/config.rb', line 4 def data @data ||= Rails.application.config_for(:totoro).with_indifferent_access end |
.get_worker(worker_class) ⇒ Object
22 23 24 |
# File 'lib/totoro/config.rb', line 22 def get_worker(worker_class) ::Worker.const_get(worker_class.to_s.camelize).new end |
.queue(id) ⇒ Object
16 17 18 19 20 |
# File 'lib/totoro/config.rb', line 16 def queue(id) name = data[:queue][id][:name] settings = { durable: data[:queue][id][:durable] } [name, settings] end |
.reset_data ⇒ Object
8 9 10 |
# File 'lib/totoro/config.rb', line 8 def reset_data @data = nil end |