Class: Array
Instance Method Summary collapse
- #collect_with_index(&block) ⇒ Object
- #get_named(str = "") ⇒ Object
- #nice_runnable(quiet = true) ⇒ Object
- #runnable(quiet = true) ⇒ Object
- #to_os ⇒ Object
- #to_string(prev = "") ⇒ Object
Instance Method Details
#collect_with_index(&block) ⇒ Object
9 10 11 |
# File 'lib/poolparty/core/array.rb', line 9 def collect_with_index &block self.enum_for(:each_with_index).collect &block end |
#get_named(str = "") ⇒ Object
21 22 23 |
# File 'lib/poolparty/core/array.rb', line 21 def get_named(str="") map {|a| a.name == str ? a : nil }.reject {|a| a.nil? } end |
#nice_runnable(quiet = true) ⇒ Object
15 16 17 |
# File 'lib/poolparty/core/array.rb', line 15 def nice_runnable(quiet=true) self.flatten.reject{|e| (e.nil? || e.empty?) }.join(" \n ").chomp.nice_runnable(quiet) end |
#runnable(quiet = true) ⇒ Object
12 13 14 |
# File 'lib/poolparty/core/array.rb', line 12 def runnable(quiet=true) self.join(" \n ").runnable(quiet) end |
#to_os ⇒ Object
6 7 8 |
# File 'lib/poolparty/core/array.rb', line 6 def to_os map {|a| a.to_os } end |
#to_string(prev = "") ⇒ Object
18 19 20 |
# File 'lib/poolparty/core/array.rb', line 18 def to_string(prev="") map {|a| a.to_string(prev)}.join("\n") end |