Module: Utracker::ModuleMethods

Included in:
Utracker
Defined in:
lib/utracker.rb

Instance Method Summary collapse

Instance Method Details

#configObject



15
16
17
# File 'lib/utracker.rb', line 15

def config
  Thread.current[:utracker_config] ||= default_configuration.freeze
end

#configure {|config| ... } ⇒ Object

Yields:



23
24
25
26
27
28
# File 'lib/utracker.rb', line 23

def configure
  self.config = default_configuration
  yield config
  self.logger = nil
  self.config.freeze
end

#loggerObject



19
20
21
# File 'lib/utracker.rb', line 19

def logger
  Thread.current[:utracker_logger] ||= (config[:logger] || config[:logger_class].new)
end