class HealthMonitor::Configuration
Constants
- PROVIDERS
Attributes
Public Class Methods
Public Instance Methods
Source
# File lib/health_monitor/configuration.rb, line 33 def init_custom_providers(provider_names) provider_names.each do |provider_name| add_custom_provider(provider_name) end end
Source
# File lib/health_monitor/configuration.rb, line 18 def no_database @providers.shift end
Private Instance Methods
Source
# File lib/health_monitor/configuration.rb, line 41 def add_custom_provider(provider_name) unless provider_name < HealthMonitor::Providers::Base raise ArgumentError.new "custom provider class #{provider_name} must implement HealthMonitor::Providers::Base" end self.class.define_method(provider_name.to_s.underscore) do |&_block| add_provider("HealthMonitor::Providers::#{provider_name}".constantize.new) end end
Source
# File lib/health_monitor/configuration.rb, line 51 def add_provider(provider) (@providers ||= []) << provider provider end