Class: MagicCloud::Debug

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/magic_cloud/debug.rb

Overview

Debugging utilities class for cloud development itself

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDebug

Returns a new instance of Debug.



17
18
19
20
# File 'lib/magic_cloud/debug.rb', line 17

def initialize
  @logger = Logger.new(STDOUT).tap{|l| l.level = Logger::FATAL}
  @stats = Hash.new{|h, k| h[k] = 0}
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



22
23
24
# File 'lib/magic_cloud/debug.rb', line 22

def logger
  @logger
end

#statsObject (readonly)

Returns the value of attribute stats.



22
23
24
# File 'lib/magic_cloud/debug.rb', line 22

def stats
  @stats
end

Class Method Details

.instanceObject



9
10
11
# File 'lib/magic_cloud/debug.rb', line 9

def instance
  @instance ||= new
end

Instance Method Details

#reset!Object



24
25
26
# File 'lib/magic_cloud/debug.rb', line 24

def reset!
  @stats = Hash.new{|h, k| h[k] = 0}
end