class Array

Public Instance Methods

all_indices() click to toggle source
# File lib/inline_acceleration.rb, line 50
def all_indices
 (0...self.size).to_a
end
assigned_indices() click to toggle source
# File lib/inline_acceleration.rb, line 54
def assigned_indices
  all_indices.reject { |i| self[i].nil? }
end
map_method_results(method_name) click to toggle source
# File lib/inline_acceleration.rb, line 85
def map_method_results(method_name)
  self.map { |item| item.send(method_name) }
end
map_method_results!(method_name) click to toggle source
# File lib/inline_acceleration.rb, line 89
def map_method_results!(method_name)
  self.map! { |item| item.send(method_name) }
end
map_with_indices(target = []) { |self, index| ... } click to toggle source
# File lib/inline_acceleration.rb, line 74
def map_with_indices(target = [])
  self.each_index do |index|
    target[index] = yield(self[index], index)
  end
  target
end
map_with_indices!() click to toggle source
# File lib/inline_acceleration.rb, line 81
def map_with_indices!
  self.map_with_indices(self)
end
method_missing(name, *args, &block) click to toggle source
# File lib/inline_acceleration.rb, line 94
def method_missing(name, *args, &block)
  if name.to_s[-1..-1] == 's'
    method_name = name.to_s[0..-2].to_sym
    if size == 0 || self[0].respond_to?(method_name)
      return map_method_results(method_name)
    end
  end
  throw_method_missing(name, args, &block)
end
Also aliased as: throw_method_missing
postfix(str) click to toggle source
# File lib/inline_acceleration.rb, line 66
def postfix(str)
  self.map { |item| "#{item}#{str}" }
end
postfix!(str) click to toggle source
# File lib/inline_acceleration.rb, line 70
def postfix!(str)
  self.map! { |item| "#{item}#{str}" }
end
prefix(str) click to toggle source
# File lib/inline_acceleration.rb, line 58
def prefix(str)
  self.map { |item| "#{str}#{item}" }
end
prefix!(str) click to toggle source
# File lib/inline_acceleration.rb, line 62
def prefix!(str)
  self.map! { |item| "#{str}#{item}" }
end
reject_nils() click to toggle source
# File lib/inline_acceleration.rb, line 104
def reject_nils
  self.reject { |item| item.nil? }
end
reject_nils!() click to toggle source
# File lib/inline_acceleration.rb, line 108
def reject_nils!
  self.reject! { |item| item.nil? }
end
throw_method_missing(name, *args, &block)
Alias for: method_missing