Method: Range#inspect

Defined in:
range.c

#inspectString

Returns a string representation of self, including begin.inspect and end.inspect:

(1..4).inspect  # => "1..4"
(1...4).inspect # => "1...4"
(1..).inspect   # => "1.."
(..4).inspect   # => "..4"

Note that returns from #to_s and #inspect may differ:

('a'..'d').to_s    # => "a..d"
('a'..'d').inspect # => "\"a\"..\"d\""

Related: Range#to_s.

Returns:


1988
1989
1990
1991
1992
# File 'range.c', line 1988

static VALUE
range_inspect(VALUE range)
{
    return rb_exec_recursive(inspect_range, range, 0);
}