Class: Array

Inherits:
Object show all
Defined in:
lib/active_scaffold/extensions/array.rb

Instance Method Summary collapse

Instance Method Details

#after(value) ⇒ Object

returns the value after the given value. wraps around. defaults to first element in array.



3
4
5
6
# File 'lib/active_scaffold/extensions/array.rb', line 3

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