Added functionality to use Mixin::RailsLogger as singleton class method.
This commit is contained in:
parent
5f0bb91481
commit
2fd72b673d
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue