Class: VitalsMonitor::Configuration
- Inherits:
-
Object
- Object
- VitalsMonitor::Configuration
- Defined in:
- lib/vitals_monitor/configuration.rb
Instance Attribute Summary collapse
-
#enabled_components ⇒ Object
Returns the value of attribute enabled_components.
Instance Method Summary collapse
- #disable(component) ⇒ Object
- #enable(component) ⇒ Object
- #enabled?(component) ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 10 11 12 13 |
# File 'lib/vitals_monitor/configuration.rb', line 7 def initialize @enabled_components = { postgres: true, redis: true, sidekiq: true } end |
Instance Attribute Details
#enabled_components ⇒ Object
Returns the value of attribute enabled_components.
5 6 7 |
# File 'lib/vitals_monitor/configuration.rb', line 5 def enabled_components @enabled_components end |
Instance Method Details
#disable(component) ⇒ Object
23 24 25 |
# File 'lib/vitals_monitor/configuration.rb', line 23 def disable(component) @enabled_components[component.to_sym] = false end |
#enable(component) ⇒ Object
19 20 21 |
# File 'lib/vitals_monitor/configuration.rb', line 19 def enable(component) @enabled_components[component.to_sym] = true end |
#enabled?(component) ⇒ Boolean
15 16 17 |
# File 'lib/vitals_monitor/configuration.rb', line 15 def enabled?(component) @enabled_components[component.to_sym] == true end |