Module: Everythingrb::InspectQuotable

Included in:
Array, Data, FalseClass, Hash, NilClass, Numeric, OpenStruct, Range, Regexp, Struct, TrueClass
Defined in:
lib/everythingrb/extensions/quotable.rb

Overview

Adds quotable functionality using inspect representation

Provides methods for wrapping an object’s inspection representation in double quotes.

Examples:

[1, 2, 3].in_quotes  # => "\"[1, 2, 3]\""

Instance Method Summary collapse

Instance Method Details

#in_quotesString Also known as: with_quotes

Adds quotable functionality using inspect representation

Provides methods for wrapping an object’s inspection representation in double quotes.

Examples:

[1, 2, 3].in_quotes      # => "\"[1, 2, 3]\""
{a: 1}.in_quotes         # => "\"{:a=>1}\""


50
51
52
# File 'lib/everythingrb/extensions/quotable.rb', line 50

def in_quotes
  %("#{inspect}")
end