Module: Gemmy::Patches::ArrayPatch::InstanceMethods::Before

Defined in:
lib/gemmy/patches/array_patch.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.autotestObject



125
126
127
# File 'lib/gemmy/patches/array_patch.rb', line 125

def self.autotest
  [1,2].before(2) == 1
end

Instance Method Details

#before(value) ⇒ Object

facets



121
122
123
124
# File 'lib/gemmy/patches/array_patch.rb', line 121

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