### Home Classes Methods

### In Files

- lib/vmail/query.rb

### Parent

Object

### Methods

- ::args2string
- ::parse

### Class/Module Index

Quicksearch

- Vmail
- Vmail::AddressQuoter
- Vmail::ContactsExtractor
- Vmail::ImapClient
- Vmail::MessageFormatter
- Vmail::Options
- Vmail::Query
- Vmail::ReplyTemplate
- Vmail::SendOptions
- Vmail::Sender
- String

No matching classes.

# Vmail::Query

### Public Class Methods

args2string(array) click to toggle source

    # File lib/vmail/query.rb, line 21
    def self.args2string(array)
      array.map {|x|
        x.to_s.split(/\s+/).size > 1 ? "\"#{x}\"" : x.to_s
      }.join(' ')
    end

parse(args) click to toggle source

args is an array like ARGV

    # File lib/vmail/query.rb, line 5
    def self.parse(args)
      if args.is_a?(String)
        args = Shellwords.shellwords args
      end
      query = if args.empty?
                [100, 'ALL']
              elsif args.size == 1 && args[0] =~ /^\d+/
                [args.shift, "ALL"]
              elsif args[0] =~ /^\d+/
                args
              else
                [100] + args
              end
      query
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.