Class: Unreliable::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/unreliable/config.rb

Class Method Summary collapse

Class Method Details

.disableObject



13
14
15
16
17
18
19
# File 'lib/unreliable/config.rb', line 13

def self.disable
  prev_enabled = @enabled
  @enabled = false
  yield
ensure
  @enabled = prev_enabled
end

.enabled?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/unreliable/config.rb', line 9

def self.enabled?
  @enabled && Rails.env.test?
end

.setup!Object



5
6
7
# File 'lib/unreliable/config.rb', line 5

def self.setup!
  @enabled = true
end