Files

AwesomePrintActiveSupport

 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

Public Class Methods

included(base) click to toggle source
    # File lib/ap/mixin/active_support.rb, line 8
 8:   def self.included(base)
 9:     base.send :alias_method, :printable_without_active_support, :printable
10:     base.send :alias_method, :printable, :printable_with_active_support
11:   end

Public Instance Methods

awesome_active_support_time(object) click to toggle source
 Format ActiveSupport::TimeWithZone as standard Time.

    # File lib/ap/mixin/active_support.rb, line 29
29:   def awesome_active_support_time(object)
30:     awesome_self(object, :as => :time)
31:   end
awesome_hash_with_indifferent_access(object) click to toggle source
 Format HashWithIndifferentAccess as standard Hash.

 NOTE: can't use awesome_self(object, :as => :hash) since awesome_self uses
 object.inspect internally, i.e. it would convert hash to string.

    # File lib/ap/mixin/active_support.rb, line 38
38:   def awesome_hash_with_indifferent_access(object)
39:     awesome_hash(object)
40:   end
printable_with_active_support(object) click to toggle source
 Add ActiveSupport class names to the dispatcher pipeline.

    # File lib/ap/mixin/active_support.rb, line 15
15:   def printable_with_active_support(object)
16:     printable = printable_without_active_support(object)
17:     if printable == :self
18:       if object.is_a?(ActiveSupport::TimeWithZone)
19:         printable = :active_support_time
20:       elsif object.is_a?(HashWithIndifferentAccess)
21:         printable = :hash_with_indifferent_access
22:       end
23:     end
24:     printable
25:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.