Class: Range
- Defined in
- lib/kyanite/range.rb,
lib/kyanite/enumerable/structure.rb
Range Additions
- Kyanite definitions
- Kyanite tests and examples
- Usage
-
require 'kyanite/range'
Added from Facets Range:
- umbrella(range)
-
Returns a two element array of the relationship between two Ranges
- within? (range)
-
Is another Range anywhere within this Range?
- combine(range)
-
Combine ranges
Instance Method Summary (collapse)
Instance Method Details
- (Range) invert_index
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/kyanite/range.rb', line 47 def invert_index # back if first == 0 return (1..0) if last == -1 # leer return (last+1..-1) # hinterer Teil # front else return (0..first-1) if last == -1 # vorderer Teil end # outer return [(first..-1).invert_index, (0..last).invert_index] end |