Sha256: 9d43e7880c8bac2238285282c632d475b6408c93656015db613488b443f42bba

Contents?: true

Size: 410 Bytes

Versions: 11

Compression:

Stored size: 410 Bytes

Contents

require 'awesome_print'

# monkey patch for AwesomePrint + objects that implement '=='
module AwesomePrint
  class Formatter
    def awesome_self(object, type)
      if @options[:raw] && object.instance_variables.any?
        awesome_object(object)
      elsif object.respond_to?(:to_hash)
        awesome_hash(object.to_hash)
      else
        colorize(object.inspect.to_s, type)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
luffa-2.1.0 lib/luffa/patches/awesome_print.rb
luffa-2.0.0 lib/luffa/patches/awesome_print.rb
luffa-1.1.0 lib/luffa/patches/awesome_print.rb
luffa-1.0.7 lib/luffa/patches/awesome_print.rb
luffa-1.0.6 lib/luffa/patches/awesome_print.rb
luffa-1.0.5 lib/luffa/patches/awesome_print.rb
luffa-1.0.4 lib/luffa/patches/awesome_print.rb
luffa-1.0.3 lib/luffa/patches/awesome_print.rb
luffa-1.0.2 lib/luffa/patches/awesome_print.rb
luffa-1.0.1 lib/luffa/patches/awesome_print.rb
luffa-1.0.0 lib/luffa/patches/awesome_print.rb