Method: Liquid::Utils.inspect

Defined in:
lib/liquid/utils.rb

.inspect(obj, seen = {}) ⇒ Object



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/liquid/utils.rb', line 111

def self.inspect(obj, seen = {})
  case obj
  when Hash
    # If the custom hash implementation overrides `#inspect`, use their
    # custom implementation. Otherwise we use Liquid's default
    # implementation.
    if obj.class.instance_method(:inspect) == HASH_INSPECT_METHOD
      hash_inspect(obj, seen)
    else
      obj.inspect
    end
  when Array
    array_inspect(obj, seen)
  else
    obj.inspect
  end
end