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.



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

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

Returns the value of attribute hide_footer.



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

def hide_footer
  @hide_footer
end

#pathObject

Returns the value of attribute path.



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

def path
  @path
end

#providersObject (readonly)

Returns the value of attribute providers.



12
13
14
# File 'lib/health_monitor/configuration.rb', line 12

def providers
  @providers
end

Instance Method Details

#add_custom_provider(custom_provider_class) ⇒ Object



33
34
35
36
37
38
39
# File 'lib/health_monitor/configuration.rb', line 33

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.new)
end

#no_databaseObject



18
19
20
# File 'lib/health_monitor/configuration.rb', line 18

def no_database
  @providers.shift
end