Sha256: df022b536f4358090769237da87c5575f5d5e1ce890599d8afda710f64fb894b

Contents?: true

Size: 654 Bytes

Versions: 11

Compression:

Stored size: 654 Bytes

Contents

=begin rdoc
  Array extensions
=end
require "enumerator"
class Array
  def to_os
    map {|a| a.to_os }
  end
  def collect_with_index &block
    self.enum_for(:each_with_index).collect &block
  end
  def runnable(quiet=true)
    self.join(" \n ").runnable(quiet)
  end
  def nice_runnable(quiet=true)
    self.flatten.reject{|e| (e.nil? || e.empty?) }.join(" \n ").chomp.nice_runnable(quiet)
  end
  def to_string(pre="")
    map {|a| a.to_string(pre)}.join("\n")
  end
  def get_named(str="")
    map {|a| a.name == str ? a : nil }.reject {|a| a.nil? }
  end
  def to_option_string(ns=[])
    "[ #{map {|e| e.to_option_string }.join(", ")} ]"
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
auser-poolparty-0.2.15 lib/poolparty/core/array.rb
auser-poolparty-0.2.16 lib/poolparty/core/array.rb
auser-poolparty-0.2.20 lib/poolparty/core/array.rb
auser-poolparty-0.2.21 lib/poolparty/core/array.rb
auser-poolparty-0.2.22 lib/poolparty/core/array.rb
auser-poolparty-0.2.23 lib/poolparty/core/array.rb
auser-poolparty-0.2.24 lib/poolparty/core/array.rb
auser-poolparty-0.2.25 lib/poolparty/core/array.rb
auser-poolparty-0.2.26 lib/poolparty/core/array.rb
auser-poolparty-0.2.35 lib/poolparty/core/array.rb
poolparty-0.2.18 lib/poolparty/core/array.rb