Skip to content

Commit

Permalink
add awesome_inspect to object class
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Bretoi committed Apr 5, 2010
1 parent eb1cf1d commit e415db6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/ap.rb
Expand Up @@ -5,6 +5,7 @@
#------------------------------------------------------------------------------
require File.dirname(__FILE__) + "/ap/core_ext/string"
require File.dirname(__FILE__) + "/ap/core_ext/kernel"
require File.dirname(__FILE__) + "/ap/core_ext/object"
require File.dirname(__FILE__) + "/ap/awesome_print"

require File.dirname(__FILE__) + "/ap/mixin/rails" if defined?(::Rails)
11 changes: 11 additions & 0 deletions lib/ap/core_ext/object.rb
@@ -0,0 +1,11 @@
# Copyright (c) 2010 Michael Dvorkin
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
class Object
def awesome_inspect(options = {})
ap = AwesomePrint.new(options)
ap.send(:awesome, self).to_s
end
end

0 comments on commit e415db6

Please sign in to comment.