class Symbol

Reopen the core Symbol class to represent {#inspect_lit}.

Public Instance Methods

inspect_lit() click to toggle source

Formats this symbol to look like a symbol literal so that object type will be inherently obvious when used in logging methods, etc.

@return [String] a symbol literal representation of this object

@example

:test.inspect_lit      # => ":\"test\"" (or ':"test"')
:"ta-da!".inspect_lit  # => ":\"ta-da!\"" (or ':"ta-da!"')
# File lib/core_ext/symbol.rb, line 13
def inspect_lit
  %(:"#{self}")
end