Class: Range
Overview
accessibility-core
extensions to the Range
class
Instance Method Summary collapse
-
#relative_to(max) ⇒ Range
Returns a new Range instance which has negative values in the receiver expanded relative to
max
.
Instance Method Details
#relative_to(max) ⇒ Range
Returns a new Range instance which has negative values in
the receiver expanded relative to max
211 212 213 214 215 216 |
# File 'lib/accessibility/bridge/mri.rb', line 211 def relative_to max beg = adjust_index self.begin, max len = adjust_index self.end, max len -= 1 if exclude_end? beg..len end |