Returns the number of messages on the POP server.
Returns an array of Net::POPMail
objects, representing all the messages on the server. This array is renewed when the session restarts; otherwise, it is fetched from the server the first time this method is called (directly or indirectly) and cached.
This method raises a POPError
if an error occurs.
This method sends a message. If msgstr
is given, sends it as a message. If block is given, yield a message writer stream. You must write message before the block is closed.
# Example 1 (by string) smtp.data(<<EndMessage) From: john@example.com To: betty@example.com Subject: I found a bug Check vm.c:58879. EndMessage # Example 2 (by block) smtp.data {|f| f.puts "From: john@example.com" f.puts "To: betty@example.com" f.puts "Subject: I found a bug" f.puts "" f.puts "Check vm.c:58879." }
Returns the path from an FTP
URI
.
RFC 1738 specifically states that the path for an FTP
URI
does not include the / which separates the URI
path from the URI
host. Example:
ftp://ftp.example.com/pub/ruby
The above URI
indicates that the client should connect to ftp.example.com then cd pub/ruby from the initial login directory.
If you want to cd to an absolute directory, you must include an escaped / (%2F) in the path. Example:
This method will then return “/pub/ruby”
Produces the summary text. Each line of the summary is yielded to the block (without newline).
sdone
Already summarized short style options keyed hash.
ldone
Already summarized long style options keyed hash.
width
Width of left side (option part). In other words, the right side (description part) starts after width
columns.
max
Maximum width of left side -> the options are filled within max
columns.
indent
Prefix string indents all summarized lines.
Adds sw
according to sopts
, lopts
and nlopts
.
sw
OptionParser::Switch
instance to be added.
sopts
Short style option list.
lopts
Long style option list.
nlopts
Negated long style options list.
Searches key
in id
list. The result is returned or yielded if a block is given. If it isn’t found, nil is returned.
Creates the summary table, passing each line to the block
(without newline). The arguments args
are passed along to the summarize method which is called on every option.
Iterates the given block for each prime number.
Returns the cached prime numbers.
Creates a new IPv6
address from arg
which may be:
IPv6
returns arg
.
arg
must match one of the IPv6::Regex* constants
Iterate over the key/value pairs:
attlist_decl.each { |attribute_name, attribute_value| ... }
This method returns a list of notations that have been declared in the internal DTD
subset. Notations in the external DTD
subset are not listed.
Method
contributed by Henrik Martensson
Retrieves a named notation. Only notations declared in the internal DTD
subset can be retrieved.
Method
contributed by Henrik Martensson
Get an array of all CData
children. IMMUTABLE
Iterates through all of the child Elements
, optionally filtering them by a given XPath
optional. If supplied, this is a String XPath
, and is used to filter the children, so that only matching children are yielded. Note that XPaths are automatically filtered for Elements
, so that non-Element children will not be yielded
doc = Document.new '<a><b/><c/><d/>sean<b/><c/><d/></a>' doc.root.elements.each {|e|p e} #-> Yields b, c, d, b, c, d elements doc.root.elements.each('b') {|e|p e} #-> Yields b, b elements doc.root.elements.each('child::node()') {|e|p e} #-> Yields <b/>, <c/>, <d/>, <b/>, <c/>, <d/> XPath.each(doc.root, 'child::node()', &block) #-> Yields <b/>, <c/>, <d/>, sean, <b/>, <c/>, <d/>