Class: MrLogaLoga::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/mr_loga_loga/configuration.rb

Overview

Description

The configuration class for MrLogaLoga

Usage

MrLogaLoga.configure do |configuration|
  configuration.logger = ...
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**kwargs) ⇒ Configuration

Initialize the configuration by setting configuration default values



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

def initialize(**kwargs)
  reset
  kwargs.each { |key, value| instance_variable_set("@#{key}", value) }
end

Instance Attribute Details

#loggerObject

Returns the value of attribute logger.



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

def logger
  @logger
end

Instance Method Details

#resetObject

Reset the configuration to default values



23
24
25
# File 'lib/mr_loga_loga/configuration.rb', line 23

def reset
  @logger = MrLogaLoga::Logger.new($stdout)
end