Class: ActiveScaffold::Ring

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

Instance Method Summary collapse

Instance Method Details

#after(value) ⇒ Object

Returns the value after the given value. Wraps around.



3
4
5
# File 'lib/active_scaffold/ring.rb', line 3

def after(value)
  include?(value) ? self[(index(value).to_i + 1) % length] : nil
end