Module: FileboundClient::Config
- Included in:
- Connection
- Defined in:
- lib/filebound_client/config.rb
Overview
Config module
Instance Method Summary collapse
-
#configuration ⇒ FileboundClient::Configuration
Retrive the current configuration.
-
#configure {|@configuration| ... } ⇒ Object
Creates a new Configuration object and yields to the caller Also sets the logger.
-
#default_logger ⇒ Logger
Retrieve the default logger.
-
#logger(message) ⇒ Object
Simple logger plugin for debugging.
Instance Method Details
#configuration ⇒ FileboundClient::Configuration
Retrive the current configuration
6 7 8 |
# File 'lib/filebound_client/config.rb', line 6 def configuration @configuration end |
#configure {|@configuration| ... } ⇒ Object
Creates a new Configuration object and yields to the caller Also sets the logger
20 21 22 23 24 25 |
# File 'lib/filebound_client/config.rb', line 20 def configure @configuration ||= Configuration.new yield @configuration @configuration.logger ||= default_logger end |
#default_logger ⇒ Logger
Retrieve the default logger
12 13 14 15 16 |
# File 'lib/filebound_client/config.rb', line 12 def default_logger logger ||= Logger.new(STDOUT) logger.level = Logger::DEBUG logger end |
#logger(message) ⇒ Object
Simple logger plugin for debugging
28 29 30 31 |
# File 'lib/filebound_client/config.rb', line 28 def logger() return unless configuration.logger configuration.logger.debug() end |