Class: Range

Inherits:
Object
  • Object
show all
Includes:
Everythingrb::InspectQuotable
Defined in:
lib/everythingrb/range.rb

Overview

Extensions to Ruby’s core Range class

Provides:

  • #in_quotes, #with_quotes: Wrap range representations in quotes

Examples:

require "everythingrb/range"

(1..5).in_quotes     # => "\"1..5\""
('a'..'z').in_quotes # => "\"a..z\""

# Helpful in error messages:
raise "Expected value in #{valid_range.in_quotes}"

Method Summary

Methods included from Everythingrb::InspectQuotable

#in_quotes