class StatusPage::Configuration

Attributes

basic_auth_credentials[RW]
error_callback[RW]
interval[RW]
providers[R]

Public Class Methods

new() click to toggle source
# File lib/status-page/configuration.rb, line 6
def initialize
  @providers = Set.new
  @interval = 10
end

Public Instance Methods

add_custom_service(custom_service_class) click to toggle source
# File lib/status-page/configuration.rb, line 22
def add_custom_service(custom_service_class)
  unless custom_service_class < StatusPage::Services::Base
    raise ArgumentError.new 'custom provider class must implement '\
      'StatusPage::Services::Base'
  end

  add_service(custom_service_class)
end
use(service_name, opts = {}) click to toggle source
# File lib/status-page/configuration.rb, line 11
def use(service_name, opts = {})
  require "status-page/services/#{service_name}"
  klass = "StatusPage::Services::#{service_name.capitalize}".constantize
  if klass.respond_to?(:configurable?) && klass.configurable?
    opts.each_key do |key|
      klass.config.send("#{key}=", opts[key])
    end
  end
  add_service(klass)
end

Private Instance Methods

add_service(provider_class) click to toggle source
# File lib/status-page/configuration.rb, line 33
def add_service(provider_class)
  (@providers ||= Set.new) << provider_class

  provider_class
end