module Squid::Config

Provides methods to read and write global configuration settings.

A typical usage is to set the default dimensions and colors for charts.

@example Set the default height for Squid graphs:

Squid.configure do |config|
  config.height = 150
end

Note that Squid.configure has precedence over values through with environment variables (see {Squid::Configuration}).

Public Instance Methods

configuration() click to toggle source

Returns the global {Squid::Configuration} object.

While this method can be used to read and write configuration settings, it is easier to use {Squid::Config#configure} Squid.configure}.

@example

Squid.configuration.height = 150

@return [Squid::Configuration] The global configuration.

# File lib/squid/config.rb, line 38
def configuration
  @configuration ||= Squid::Configuration.new
end
configure() { |configuration| ... } click to toggle source

Yields the global configuration to the given block.

@example

Squid.configure do |config|
  config.height = 150
end

@yield [Squid::Configuration] The global configuration.

# File lib/squid/config.rb, line 25
def configure
  yield configuration if block_given?
end