Class: HealthMonitor::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/health_monitor/configuration.rb

Constant Summary collapse

PROVIDERS =
%i[cache database delayed_job redis resque sidekiq].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



10
11
12
# File 'lib/health_monitor/configuration.rb', line 10

def initialize
  database
end

Instance Attribute Details

#basic_auth_credentialsObject

Returns the value of attribute basic_auth_credentials.



7
8
9
# File 'lib/health_monitor/configuration.rb', line 7

def basic_auth_credentials
  @basic_auth_credentials
end

#environment_variablesObject

Returns the value of attribute environment_variables.



7
8
9
# File 'lib/health_monitor/configuration.rb', line 7

def environment_variables
  @environment_variables
end

#error_callbackObject

Returns the value of attribute error_callback.



7
8
9
# File 'lib/health_monitor/configuration.rb', line 7

def error_callback
  @error_callback
end

#providersObject (readonly)

Returns the value of attribute providers.



8
9
10
# File 'lib/health_monitor/configuration.rb', line 8

def providers
  @providers
end

Instance Method Details

#add_custom_provider(custom_provider_class) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/health_monitor/configuration.rb', line 25

def add_custom_provider(custom_provider_class)
  unless custom_provider_class < HealthMonitor::Providers::Base
    raise ArgumentError.new 'custom provider class must implement '\
      'HealthMonitor::Providers::Base'
  end

  add_provider(custom_provider_class)
end

#no_databaseObject



14
15
16
# File 'lib/health_monitor/configuration.rb', line 14

def no_database
  @providers.delete(HealthMonitor::Providers::Database)
end