Class: Akaer::Configuration

Inherits:
Bovem::Configuration
  • Object
show all
Defined in:
lib/akaer/configuration.rb

Overview

This class holds the configuration of the application.

Instance Method Summary (collapse)

Constructor Details

- (Configuration) initialize(file = nil, overrides = {}, logger = nil)

Creates a new configuration.

Parameters:

  • file (String) (defaults to: nil)

    The file to read.

  • overrides (Hash) (defaults to: {})

    A set of values which override those set in the configuration file.

  • logger (Logger) (defaults to: nil)

    The logger to use for notifications.



45
46
47
48
49
50
51
52
53
54
# File 'lib/akaer/configuration.rb', line 45

def initialize(file = nil, overrides = {}, logger = nil)
  super(file, overrides, logger)

  # Make sure some arguments are of correct type
  self.log_file = $stdout if log_file == "STDOUT"
  self.log_file = $stderr if log_file == "STDERR"
  self.addresses = addresses.ensure_array
  self.aliases = aliases.to_integer
  self.log_level = log_level.to_integer
end