class Array

Public Instance Methods

select!() { |x| ... } click to toggle source
# File lib/http/cookie/ruby_compat.rb, line 2
def select! # :yield: x
  i = 0
  each_with_index { |x, j|
    yield x or next
    self[i] = x if i != j
    i += 1
  }
  return nil if i == size
  self[i..-1] = []
  self
end
sort_by!() { |x| ... } click to toggle source
# File lib/http/cookie/ruby_compat.rb, line 14
def sort_by!(&block) # :yield: x
  replace(sort_by(&block))
end