Class: Array

Inherits:
Object show all
Defined in:
lib/six-updater-web/vendor/plugins/active_scaffold/lib/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/six-updater-web/vendor/plugins/active_scaffold/lib/extensions/array.rb', line 3

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