Module: Kernel
- Defined in:
- lib/amazing_print/core_ext/kernel.rb
Overview
Copyright © 2010-2016 Michael Dvorkin and contributors
AmazingPrint is freely distributable under the terms of MIT license. See LICENSE file or www.opensource.org/licenses/mit-license.php
Class Method Summary collapse
Instance Method Summary collapse
- #ai(options = {}) ⇒ Object (also: #awesome_inspect)
Class Method Details
.ap(object, options = {}) ⇒ Object
20 21 22 23 |
# File 'lib/amazing_print/core_ext/kernel.rb', line 20 def ap(object, = {}) puts object.ai() object unless AmazingPrint.console? end |
Instance Method Details
#ai(options = {}) ⇒ Object Also known as: awesome_inspect
9 10 11 12 13 14 15 16 17 |
# File 'lib/amazing_print/core_ext/kernel.rb', line 9 def ai( = {}) ap = AmazingPrint::Inspector.new() awesome = ap.awesome self if [:html] awesome = "<pre>#{awesome}</pre>" awesome = awesome.html_safe if defined? ActiveSupport end awesome end |