Skip to content

Instantly share code, notes, and snippets.

@roobert
Created November 21, 2016 14:05
Show Gist options
  • Save roobert/4bb42d0e7ffcf982b9c723465bedc1ca to your computer and use it in GitHub Desktop.
Save roobert/4bb42d0e7ffcf982b9c723465bedc1ca to your computer and use it in GitHub Desktop.
class Logger
def self.logger
@logger ||= object_id
end
def message(m)
puts m
end
module Stuff
def logmsg(m)
logger.message(m)
end
end
end
class Test0
include Logger::Stuff
attr_accessor :log
def initialize(logger: Logger.new)
log = logger
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment