Class: Aoororachain::Configuration
- Inherits:
-
Object
- Object
- Aoororachain::Configuration
- 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
-
#log_level ⇒ Object
Sets the logger’s log level for the Aoororachain service client.
-
#logger ⇒ Object
Sets the logger for the Aoororachain service client.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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_level ⇒ Object
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 |
#logger ⇒ Object
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
.setup ⇒ Object
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 |