### Home Classes Methods

### In Files

- lib/facets/tuple.rb
- lib/facets/set.rb
- lib/facets/pathname.rb
- lib/facets/random.rb
- lib/facets/shellwords.rb

### Parent

Object

### Methods

- #power_set
- #shelljoin
- #shellwords
- #to_path
- #to_t

### Included Modules

- Random::ArrayExtensions

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- Random
- Random::ArrayExtensions
- Random::HashExtensions
- Random::IntegerExtensions
- Random::NumericExtensions
- Random::RangeExtensions
- Random::StringExtensions
- Random::StringExtensions::Self
- FileUtils
- FileUtils::DryRun
- FileUtils::NoWrite
- FileUtils::Verbose
- Digest
- Digest::Class
- Digest::Instance
- Multiton
- Multiton::Inclusive
- Multiton::MetaMethods
- URI
- URI::Hash
- URI::Kernel
- Argvector
- Argvector
- ERB
- ERB::OpenTemplate
- Enumerable
- Enumerable::Arguments
- GetoptLong
- GetoptLong::DSL
- Memoizable
- Memoizable::Copy
- Numeric
- Numeric::Multipliers
- Object
- Object::ArgVector
- Timer
- Timer::Dummy
- Array
- BasicObject
- CGI
- Cloneable
- Continuation
- Date
- DateTime
- Equitable
- File
- Find
- Hash
- Instantiable
- Integer
- Interval
- Kernel
- Math
- Module
- Net
- NilClass
- NullClass
- OpEsc
- OpenStruct
- Pathname
- Platform
- Range
- RbConfig
- Set
- Shellwords
- String
- StringScanner
- Time
- Tuple
- YAML
- Zlib

No matching classes.

# Array

### Public Instance Methods

power_set() click to toggle source

@author Phrogz

    # File lib/facets/set.rb, line 24
    def power_set
      if empty?
        [self]
      else
        subset  = dup
        value   = [ subset.pop ]
        subsubs = subset.power_set
        subsubs.concat( subsubs.map{ |subset| subset + value } )
      end
    end

shelljoin() click to toggle source

    # File lib/facets/shellwords.rb, line 78
    def shelljoin
      Shellwords.shelljoin(shellwords)
    end

shellwords() click to toggle source

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

    # File lib/facets/shellwords.rb, line 71
    def shellwords
      opts, args = *flatten.partition{ |e| Hash === e }
      opts = opts.inject({}){ |m,h| m.update(h); m }
      opts.shellwords + args
    end

to_path() click to toggle source

Convert array to Pathname instance.

@standard

    require 'facets/pathname'

    # File lib/facets/pathname.rb, line 250
    def to_path
      Pathname.new(join('/'))
    end

to_t() click to toggle source

Convert an array into a tuple.

    # File lib/facets/tuple.rb, line 276
    def to_t
      Tuple.cast_from_array( self )
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.