Module: Reap::Extensions::Array

Included in:
Array
Defined in:
lib/reap/extensions/array.rb

Overview

Array Extensions

Instance Method Summary collapse

Instance Method Details

#not_empty?Boolean

Not empty?

Returns:

  • (Boolean)


10
11
12
# File 'lib/reap/extensions/array.rb', line 10

def not_empty?
  !empty?
end

#to_consoleObject Also known as: to_params

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



18
19
20
21
22
# File 'lib/reap/extensions/array.rb', line 18

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