# # # # # # # # #
# /36/dd_example.rb
#
# by               Jan Lelis
# e-mail:          mail@janlelis.de
# type/version:    ruby 
# snippet url:     http://rbJL.net/36/dd_example.rb
# original post:   http://rbJL.net/36-little-heplers-for-ruby-print-debugging
# license:         CC-BY (DE)
#
# (c) 2010 Jan Lelis.

# example usage
require 'zucker/debug'

some.d.methods.d.noone.d.knows.d
# ...outputs 4 lines with the inspected objects
# => (result)

21 + Math.sin(42).d
# outputs -0.916521547915634
# => 20.0834784520844

name = 'Earth'
'Hello ' + name.d{|e| "The length is: #{e.size}"}
# outputs "The length is: 5"
# => 'Hello Earth'