Class: Aoororachain::Configuration

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

Overview

The Configuration class allows you to configure Aoororachain It can be initialized directly calling #new method.

Examples

configuration = Aoororachain::Configuration.new
configurarion.logger = Logger.new($stdout)

Or via a setup block.

Examples

Aoororachain::Configuration.setup do |config|
  config.logger = Logger.new($stdout)
end

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



43
44
45
# File 'lib/aoororachain/configuration.rb', line 43

def initialize
  @log_level = Aoororachain::LEVEL_INFO
end

Instance Attribute Details

#log_levelObject

Sets the logger’s log level for the Aoororachain service client.

Examples

config.log_level = Aoororachain::LEVEL_INFO

Returns the log level constant



35
36
37
# File 'lib/aoororachain/configuration.rb', line 35

def log_level
  @log_level
end

#loggerObject

Sets the logger for the Aoororachain service client.

Examples

config.logger = Logger.new(STDOUT)

Returns the Logger instance.



27
28
29
# File 'lib/aoororachain/configuration.rb', line 27

def logger
  @logger
end

Class Method Details

.setupObject



37
38
39
40
41
# File 'lib/aoororachain/configuration.rb', line 37

def self.setup
  new.tap do |instance|
    yield(instance) if block_given?
  end
end