Class: Array

Inherits:
Object show all
Defined in:
lib/ratch/core_ext/to_list.rb,
lib/ratch/core_ext/to_console.rb

Instance Method Summary collapse

Instance Method Details

#to_consoleObject Also known as: to_params

Convert an array into commandline parameters. The array is accepted in the format of Ruby method arguments –ie. [arg1, arg2, …, hash]



8
9
10
11
12
# File 'lib/ratch/core_ext/to_console.rb', line 8

def to_console
  flags = (Hash===last ? pop : {})
  flags = flags.to_console
  flags + ' ' + join(" ")
end

#to_listObject



3
4
5
# File 'lib/ratch/core_ext/to_list.rb', line 3

def to_list
  self
end