Module: Nis::Configuration

Included in:
Nis
Defined in:
lib/nis/configuration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#loggerLogger

Logger for #debug, default is ‘Nis::Logger.new(STDOUT)`

Returns:

  • (Logger)


7
8
9
# File 'lib/nis/configuration.rb', line 7

def logger
  @logger
end

Class Method Details

.extended(base) ⇒ Object



9
10
11
# File 'lib/nis/configuration.rb', line 9

def self.extended(base)
  base.logger = Logger.new($stdout).tap { |logger| logger.level = Logger::INFO }
end

Instance Method Details

#configure {|self| ... } ⇒ Object

Examples:

Nis.configure do |conf|
  conf.logger = Logger.new('path/to/nis-ruby.log')
  conf.logger.level = Logger::DEBUG
end

Yields:

  • (self)


19
20
21
# File 'lib/nis/configuration.rb', line 19

def configure
  yield self
end