Module: Kernel
- Defined in:
- lib/debug_print.rb
Instance Method Summary collapse
- #dap(object, options = {}) ⇒ Object
- #debug_print(object, options = {}) ⇒ Object (also: #dp)
- #dpp(object, options = {}) ⇒ Object
- #dputs(object, options = {}) ⇒ Object
Instance Method Details
#dap(object, options = {}) ⇒ Object
49 50 51 |
# File 'lib/debug_print.rb', line 49 def dap(object, = {}) debug_print(object, .merge({printer: :ap})) end |
#debug_print(object, options = {}) ⇒ Object Also known as: dp
33 34 35 36 37 38 39 |
# File 'lib/debug_print.rb', line 33 def debug_print(object, = {}) return if DebugPrint.silent print = [:printer] || DebugPrint.printer label = [:label] || 'DEBUG' puts "[#{label}: from #{caller.first}]" Kernel.send(print, object) end |
#dpp(object, options = {}) ⇒ Object
45 46 47 |
# File 'lib/debug_print.rb', line 45 def dpp(object, = {}) debug_print(object, .merge({printer: :pp})) end |
#dputs(object, options = {}) ⇒ Object
41 42 43 |
# File 'lib/debug_print.rb', line 41 def dputs(object, = {}) debug_print(object, .merge({printer: :puts})) end |