class Array

@file @brief @author ongaeshi @date 2012/06/11

Public Instance Methods

diff(other) click to toggle source
# File lib/milkode/common/array_diff.rb, line 8
def diff(other)
  self_diff = self.reject {|i| other.include? i}
  other_diff = other.reject {|j| self.include? j}
  
  return [self_diff, other_diff]
end
map_with_index(&block) click to toggle source
# File lib/milkode/cdweb/app.rb, line 450
def map_with_index(&block)
  dup.map_with_index!(&block)
end
map_with_index!() { |e, idx| ... } click to toggle source
# File lib/milkode/cdweb/app.rb, line 446
def map_with_index!
  each_with_index do |e, idx| self[idx] = yield(e, idx); end
end