Class Array
In: lib/more/facets/random.rb
lib/more/facets/tuple.rb
lib/more/facets/set.rb
lib/more/facets/shellwords.rb
Parent: Object

Convert and array into a tuple.

Methods

Included Modules

Random

Public Instance methods

[Source]

    # File lib/more/facets/set.rb, line 16
16:   def power_set
17:     if empty?
18:       [self]
19:     else
20:       subset  = dup
21:       value   = [ subset.pop ]
22:       subsubs = subset.power_set
23:       subsubs.concat( subsubs.map{ |subset| subset + value } )
24:     end
25:   end
to_console()

Alias for to_shell

[Source]

    # File lib/more/facets/shellwords.rb, line 50
50:   def to_shell
51:     to_shellwords.join(' ')
52:   end

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

[Source]

    # File lib/more/facets/shellwords.rb, line 44
44:   def to_shellwords
45:     flags = (Hash===last ? pop : {})
46:     flags = flags.to_shellwords
47:     flags + ' ' + self #join(" ")
48:   end

[Source]

     # File lib/more/facets/tuple.rb, line 320
320:   def to_t
321:     Tuple.cast_from_array( self )
322:   end

[Validate]