Module: MeasureSupport
Overview
- Author
-
Kenta Murata
- Copyright
-
Copyright © 2008 Kenta Murata
- License
-
LGPL version 3.0
Class Method Summary collapse
Class Method Details
.disable ⇒ Object
14 15 16 |
# File 'lib/measure/support.rb', line 14 def self.disable Thread.current[:measure_support_enabled] = false end |
.enable ⇒ Object
10 11 12 |
# File 'lib/measure/support.rb', line 10 def self.enable Thread.current[:measure_support_enabled] = true end |
.enable? ⇒ Boolean
6 7 8 |
# File 'lib/measure/support.rb', line 6 def self.enable? Thread.current[:measure_support_enabled] end |
.included(mod) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/measure/support.rb', line 18 def self.included(mod) mod.module_eval %Q{ alias measure_support_saved_method_missing method_missing private_methods :measure_support_saved_method_missing def method_missing(name, *args) if MeasureSupport.enable? return Measure.new(self, name) if Measure.defined?(name) end return measure_support_saved_method_missing(name, *args) end } end |