Class: Symbol

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

Instance Method Summary collapse

Instance Method Details

#inspect_litString

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

Examples:

:test.inspect_lit      # => ":\"test\"" (or ':"test"')
:"ta-da!".inspect_lit  # => ":\"ta-da!\"" (or ':"ta-da!"')

Returns:

  • (String)

    a symbol literal representation of this object



10
11
12
# File 'lib/object_identifier/core_ext/symbol.rb', line 10

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