Module: Everythingrb::StringQuotable

Included in:
Date, DateTime, String, Time
Defined in:
lib/everythingrb/extensions/quotable.rb

Overview

Adds quotable functionality using to_s representation

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

Examples:

Time.now.in_quotes  # => "\"2025-05-03 12:34:56 -0400\""

Instance Method Summary collapse

Instance Method Details

#in_quotesString Also known as: with_quotes

Returns the object’s string representation wrapped in double quotes

Examples:

Date.today.in_quotes      # => "\"2025-05-03\""
Time.now.in_quotes        # => "\"2025-05-03 12:34:56 -0400\""

Returns:

  • (String)

    The object’s to_s representation surrounded by double quotes



76
77
78
# File 'lib/everythingrb/extensions/quotable.rb', line 76

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