Added functionality to use Mixin::RailsLogger as singleton class method.

This commit is contained in:
Thorsten Eckel 2017-08-30 16:51:03 +02:00
parent 5f0bb91481
commit 2fd72b673d

View file

@ -1,9 +1,16 @@
module Mixin
module RailsLogger
# add logger method for instance method access
extend Forwardable
extend SingleForwardable
instance_delegate [:logger] => self
single_delegate [:logger] => :Rails
# add logger method for class method access
def self.included(base)
base.extend(SingleForwardable)
base.single_delegate [:logger] => :Rails
end
end
end