Class: Array
Instance Method Summary collapse
-
#after(value) ⇒ Object
returns the value after the given value.
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 |