class Net::IMAP::SearchResult

def to_s(type = "SEARCH")


data.to_s(nil) # => "1 3 16 1024 (MODSEQ 2048)"
data.to_s("SORT") # => "* SORT 1 3 16 1024 (MODSEQ 2048)"
data.to_s # => "* SEARCH 1 3 16 1024 (MODSEQ 2048)"
data = Net::IMAP::SearchResult[1, 3, 16, 1024, modseq: 2048]

data.to_s(nil) # => "2 8 32 128 256 512"
data.to_s("SORT") # => "* SORT 2 8 32 128 256 512"
data.to_s("SEARCH") # => "* SEARCH 2 8 32 128 256 512"
data.to_s # => "* SEARCH 2 8 32 128 256 512"
data = Net::IMAP::SearchResult[2, 8, 32, 128, 256, 512]

Returns a string that follows the formal \IMAP syntax.
def to_s(type = "SEARCH")
  str = +""
  str << "* %s " % [type.to_str] unless type.nil?
  str << join(" ")
  str << " (MODSEQ %d)" % [modseq] if modseq
  -str
end