Class: String

Inherits:
Object show all
Defined in:
lib/object_identifier/core_ext/string.rb

Instance Method Summary collapse

Instance Method Details

#inspect_litString

Formats self to look like a String literal so that object type will be inherently obvious when inspected.

Examples:

"test".inspect_lit  # => "\"test\"" (i.e. '"test"')
"1".inspect_lit     # => "\"1\""    (i.e. '"1"')
"12.3".inspect_lit  # => "\"12.3\"" (i.e. '"12.3"')

Returns:

  • (String)

    a String-literal representation of this object



11
12
13
# File 'lib/object_identifier/core_ext/string.rb', line 11

def inspect_lit
  %("#{to_s}")
end