Module: Everythingrb

Defined in:
lib/everythingrb/prelude.rb,
lib/railtie.rb,
lib/everythingrb/version.rb,
lib/everythingrb/extensions/quotable.rb

Overview

Extensions for making objects quotable with double quotes

These modules add the ability to quote objects by wrapping their string representations in double quotes. This is useful for generating error messages, debug output, or formatted logs where you want to clearly distinguish between different value types.

Examples:

Basic usage with different types

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

Using with collections

values = [1, nil, "hello"]
values.map(&:in_quotes)       # => ["\"1\"", "\"nil\"", "\"\\\"hello\\\"\""]

Error messages

expected = 42
actual = nil
raise "Expected #{expected.in_quotes} but got #{actual.in_quotes}"
# => "Expected \"42\" but got \"nil\""

Defined Under Namespace

Modules: InspectQuotable, StringQuotable Classes: Railtie

Constant Summary collapse

VERSION =

Current version of the everythingrb gem

"0.8.2"