Class: Symbol

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

Overview

Extensions to Ruby’s core Symbol class

Provides:

  • #with_quotes, #in_quotes: Wrap symbols in quotes

Examples:

require "everythingrb/symbol"

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

Instance Method Summary collapse

Instance Method Details

#in_quotesSymbol Also known as: with_quotes

Returns self wrapped in double quotes

Examples:

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


24
25
26
# File 'lib/everythingrb/symbol.rb', line 24

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