Class: SourceMonitor::Configuration::RealtimeSettings
- Inherits:
-
Object
- Object
- SourceMonitor::Configuration::RealtimeSettings
- Defined in:
- lib/source_monitor/configuration/realtime_settings.rb
Defined Under Namespace
Classes: SolidCableOptions
Constant Summary collapse
- VALID_ADAPTERS =
%i[solid_cable redis async].freeze
Instance Attribute Summary collapse
-
#adapter ⇒ Object
Returns the value of attribute adapter.
-
#redis_url ⇒ Object
Returns the value of attribute redis_url.
-
#solid_cable ⇒ Object
Returns the value of attribute solid_cable.
Instance Method Summary collapse
- #action_cable_config ⇒ Object
-
#initialize ⇒ RealtimeSettings
constructor
A new instance of RealtimeSettings.
- #reset! ⇒ Object
Constructor Details
#initialize ⇒ RealtimeSettings
Returns a new instance of RealtimeSettings.
11 12 13 |
# File 'lib/source_monitor/configuration/realtime_settings.rb', line 11 def initialize reset! end |
Instance Attribute Details
#adapter ⇒ Object
Returns the value of attribute adapter.
8 9 10 |
# File 'lib/source_monitor/configuration/realtime_settings.rb', line 8 def adapter @adapter end |
#redis_url ⇒ Object
Returns the value of attribute redis_url.
9 10 11 |
# File 'lib/source_monitor/configuration/realtime_settings.rb', line 9 def redis_url @redis_url end |
#solid_cable ⇒ Object
Returns the value of attribute solid_cable.
8 9 10 |
# File 'lib/source_monitor/configuration/realtime_settings.rb', line 8 def solid_cable @solid_cable end |
Instance Method Details
#action_cable_config ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/source_monitor/configuration/realtime_settings.rb', line 34 def action_cable_config case adapter when :solid_cable solid_cable.to_h.merge(adapter: "solid_cable") when :redis config = { adapter: "redis" } config[:url] = redis_url if redis_url.present? config when :async { adapter: "async" } else {} end end |
#reset! ⇒ Object
24 25 26 27 28 |
# File 'lib/source_monitor/configuration/realtime_settings.rb', line 24 def reset! @solid_cable = SolidCableOptions.new @redis_url = nil self.adapter = :solid_cable end |