Class: Array
- Defined in:
- lib/detroit/core_ext/to_console.rb,
lib/detroit/core_ext/to_list.rb
Overview
:nodoc:
Instance Method Summary collapse
- #to_argv ⇒ Object
-
#to_console ⇒ Object
(also: #to_params)
Convert an array into commandline parameters.
- #to_list ⇒ Object
Instance Method Details
#to_argv ⇒ Object
22 23 24 25 26 |
# File 'lib/detroit/core_ext/to_console.rb', line 22 def to_argv flags = (Hash===last ? pop : {}) flags = flags.to_argv flags + self end |
#to_console ⇒ Object 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]
11 12 13 14 15 16 |
# File 'lib/detroit/core_ext/to_console.rb', line 11 def to_console #flags = (Hash===last ? pop : {}) #flags = flags.to_console #flags + ' ' + join(" ") to_argv.join(' ') end |
#to_list ⇒ Object
3 4 5 |
# File 'lib/detroit/core_ext/to_list.rb', line 3 def to_list self end |