Method: Array#inspect

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

#inspect(max_elements = 10) ⇒ String

Returns String representation of the array.

Parameters:

  • max_elements (Integer) (defaults to: 10)

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

Returns:

  • (String)

    String representation of the array



35
36
37
38
39
40
41
# File 'lib/openc3/core_ext/array.rb', line 35

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