Class: Alephant::DelegatingLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/alephant/logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logger) ⇒ DelegatingLogger

Returns a new instance of DelegatingLogger.



8
9
10
# File 'lib/alephant/logger.rb', line 8

def initialize(logger)
  @logger = logger
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



12
13
14
# File 'lib/alephant/logger.rb', line 12

def method_missing(name, *args)
  logger.send(name, *args) if logger.respond_to? name
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



6
7
8
# File 'lib/alephant/logger.rb', line 6

def logger
  @logger
end

Instance Method Details

#respond_to?(name) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/alephant/logger.rb', line 16

def respond_to?(name)
  logger.respond_to? name || super
end