Class: MagicCloud::Debug
- Inherits:
-
Object
- Object
- MagicCloud::Debug
- Extended by:
- Forwardable
- Defined in:
- lib/magic_cloud/debug.rb
Overview
Debugging utilities class for cloud development itself
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#stats ⇒ Object
readonly
Returns the value of attribute stats.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Debug
constructor
A new instance of Debug.
- #reset! ⇒ Object
Constructor Details
#initialize ⇒ Debug
Returns a new instance of Debug.
18 19 20 21 |
# File 'lib/magic_cloud/debug.rb', line 18 def initialize @logger = Logger.new($stdout).tap { |l| l.level = Logger::FATAL } @stats = Hash.new { |h, k| h[k] = 0 } end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
23 24 25 |
# File 'lib/magic_cloud/debug.rb', line 23 def logger @logger end |
#stats ⇒ Object (readonly)
Returns the value of attribute stats.
23 24 25 |
# File 'lib/magic_cloud/debug.rb', line 23 def stats @stats end |
Class Method Details
.instance ⇒ Object
10 11 12 |
# File 'lib/magic_cloud/debug.rb', line 10 def instance @instance ||= new end |
Instance Method Details
#reset! ⇒ Object
25 26 27 |
# File 'lib/magic_cloud/debug.rb', line 25 def reset! @stats = Hash.new { |h, k| h[k] = 0 } end |