Method: Hash#inspect

Defined in:
lib/openc3/core_ext/hash.rb

#inspect(max_elements = 10) ⇒ String

Returns String representation of the hash.

Parameters:

  • max_elements (Integer) (defaults to: 10)

    The maximum number of elements in the Hash to print out before simply displaying the Hash class and object id

Returns:

  • (String)

    String representation of the hash



33
34
35
36
37
38
39
# File 'lib/openc3/core_ext/hash.rb', line 33

def inspect(max_elements = 10)
  if self.length <= max_elements
    old_inspect()
  else
    '#<' + self.class.to_s + ':' + self.object_id.to_s + '>'
  end
end