# Range

The range object class. See Range Expressions for more information.

### Superclass

* Object

### Included Module

* Enumerable

### Methods

self === other

This method is mostly used for comparison within case statements. Returns true if other is within range.

beginfirst

Returns the initial element.

each {|item| ... }

Iterates over each element within the range.

endlast

Returns the end point, regardless of whether the range object is inclusive of the end point.

```
p (1..5).end   # => 5
p (1...5).end  # => 5
```

exclude\_end?

Returns true if the range object is exclusive of the end point.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://enls.gitbook.io/rgss-reference-manual/standard-library/built-in-classes/object/range.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
