Method: AppMap::ValueInspector#detect_size

Defined in:
lib/appmap/value_inspector.rb

#detect_size(value) ⇒ Object



8
9
10
11
12
13
# File 'lib/appmap/value_inspector.rb', line 8

def detect_size(value)
  # Don't risk calling #size on things like data-access objects, which can and will issue queries for this information.
  if (value.is_a?(Array) || value.is_a?(Hash)) && value.respond_to?(:size)
    value.size
  end
end