Class: Symbol

Inherits:
Object
  • Object
show all
Defined in:
lib/everythingrb/core/symbol.rb

Overview

Extensions to Ruby’s core Symbol class

These additions provide handy formatting helpers for symbols.

Examples:

:hello_world.with_quotes  # => :"\"hello_world\""

Instance Method Summary collapse

Instance Method Details

#with_quotesSymbol Also known as: in_quotes

Returns self wrapped in double quotes

Examples:

:hello_world.with_quotes  # => :"\"hello_world\""
:hello_world.in_quotes    # => :"\"hello_world\""

Returns:

  • (Symbol)

    The symbol with surrounding double quotes



21
22
23
# File 'lib/everythingrb/core/symbol.rb', line 21

def with_quotes
  :"\"#{self}\""
end