Class: Alchemrest::KillSwitch
- Inherits:
-
Object
- Object
- Alchemrest::KillSwitch
- Defined in:
- lib/alchemrest/kill_switch.rb,
lib/alchemrest/kill_switch/adapters.rb
Defined Under Namespace
Modules: Adapters
Instance Method Summary collapse
- #activate! ⇒ Object
- #active? ⇒ Boolean
- #deactivate! ⇒ Object
-
#initialize(service_name:) ⇒ KillSwitch
constructor
A new instance of KillSwitch.
Constructor Details
#initialize(service_name:) ⇒ KillSwitch
Returns a new instance of KillSwitch.
7 8 9 10 11 |
# File 'lib/alchemrest/kill_switch.rb', line 7 def initialize(service_name:) raise ArgumentError, 'service_name is required' unless service_name super end |
Instance Method Details
#activate! ⇒ Object
17 18 19 |
# File 'lib/alchemrest/kill_switch.rb', line 17 def activate! adapter.activate(service_name:) end |
#active? ⇒ Boolean
13 14 15 |
# File 'lib/alchemrest/kill_switch.rb', line 13 def active? adapter.active?(service_name:) end |
#deactivate! ⇒ Object
21 22 23 |
# File 'lib/alchemrest/kill_switch.rb', line 21 def deactivate! adapter.deactivate(service_name:) end |