Class: Totoro::Config
- Inherits:
-
Object
- Object
- Totoro::Config
- Defined in:
- lib/totoro/config.rb
Instance Method Summary collapse
- #connect ⇒ Object
-
#initialize(prefix = nil) ⇒ Config
constructor
A new instance of Config.
- #queue(id) ⇒ Object
- #reset_data ⇒ Object
Constructor Details
#initialize(prefix = nil) ⇒ Config
Returns a new instance of Config.
5 6 7 8 |
# File 'lib/totoro/config.rb', line 5 def initialize(prefix = nil) @data = Rails.application.config_for(:totoro).with_indifferent_access @data = @data[prefix] if prefix.present? end |
Instance Method Details
#connect ⇒ Object
14 15 16 |
# File 'lib/totoro/config.rb', line 14 def connect @data[:connect] end |
#queue(id) ⇒ Object
18 19 20 21 22 |
# File 'lib/totoro/config.rb', line 18 def queue(id) name = @data[:queue][id][:name] settings = { durable: @data[:queue][id][:durable] } [name, settings] end |
#reset_data ⇒ Object
10 11 12 |
# File 'lib/totoro/config.rb', line 10 def reset_data @data = nil end |