Class: CircularArray

Inherits:
Array
  • Object
show all
Defined in:
lib/circular_array.rb

Constant Summary collapse

VERSION =
'0.2.1'

Instance Method Summary collapse

Instance Method Details

#[](index) ⇒ Object



6
7
8
9
10
# File 'lib/circular_array.rb', line 6

def [](index)
  return nil if empty?

  super(index % size)
end