Class: SimpleDebugLogging

Inherits:
Module
  • Object
show all
Defined in:
lib/simple_debug_logging.rb

Defined Under Namespace

Modules: ClassMethodLogger, InstanceMethodLoggerModulizer

Instance Method Summary collapse

Constructor Details

#initialize(i_methods: nil) ⇒ SimpleDebugLogging

Returns a new instance of SimpleDebugLogging.



41
42
43
# File 'lib/simple_debug_logging.rb', line 41

def initialize(i_methods: nil)
  @instance_methods_to_log = Array(i_methods) if i_methods
end

Instance Method Details

#included(base) ⇒ Object



44
45
46
47
48
# File 'lib/simple_debug_logging.rb', line 44

def included(base)
  instance_method_logger = InstanceMethodLoggerModulizer.to_mod(@instance_methods_to_log)
  base.send(:prepend, instance_method_logger)
  base.send(:extend, ClassMethodLogger)
end