Alias for CSV::read()
.
Rewinds the underlying IO
object and resets CSV’s lineno() counter.
Returns a simplified description of the key CSV
attributes in an ASCII compatible String.
Returns the list of waiting threads.
When stepping through the traces of a function, thread gets suspended, to be resumed later.
Taint both the object returned by _getobj_ and self.
Untaint both the object returned by _getobj_ and self.
Set
the handling of the ordering of options and arguments. A RuntimeError
is raised if option processing has already started.
The supplied value must be a member of GetoptLong::ORDERINGS
. It alters the processing of options as follows:
REQUIRE_ORDER :
Options are required to occur before non-options.
Processing of options ends as soon as a word is encountered that has not been preceded by an appropriate option flag.
For example, if -a and -b are options which do not take arguments, parsing command line arguments of ‘-a one -b two’ would result in ‘one’, ‘-b’, ‘two’ being left in ARGV, and only (‘-a’, ”) being processed as an option/arg pair.
This is the default ordering, if the environment variable POSIXLY_CORRECT is set. (This is for compatibility with GNU getopt_long.)
PERMUTE :
Options can occur anywhere in the command line parsed. This is the default behavior.
Every sequence of words which can be interpreted as an option (with or without argument) is treated as an option; non-option words are skipped.
For example, if -a does not require an argument and -b optionally takes an argument, parsing ‘-a one -b two three’ would result in (‘-a’,”) and (‘-b’, ‘two’) being processed as option/arg pairs, and ‘one’,‘three’ being left in ARGV.
If the ordering is set to PERMUTE but the environment variable POSIXLY_CORRECT is set, REQUIRE_ORDER is used instead. This is for compatibility with GNU getopt_long.
RETURN_IN_ORDER :
All words on the command line are processed as options. Words not preceded by a short or long option flag are passed as arguments with an option of ” (empty string).
For example, if -a requires an argument but -b does not, a command line of ‘-a one -b two three’ would result in option/arg pairs of (‘-a’, ‘one’) (‘-b’, ”), (”, ‘two’), (”, ‘three’) being processed.
Returns a new ipaddr built by masking IP address with the given prefixlen/netmask. (e.g. 8, 64, “255.255.255.0”, etc.)
Returns true if the given ipaddr is in the range.
e.g.:
require 'ipaddr' net1 = IPAddr.new("192.168.2.0/24") net2 = IPAddr.new("192.168.2.100") net3 = IPAddr.new("192.168.3.0") p net1.include?(net2) #=> true p net1.include?(net3) #=> false
Returns a string containing a human-readable representation of the ipaddr. (“#<IPAddr: family:address/mask>”)
Set
current netmask to given mask.
Returns true
iff the current severity level allows for the printing of INFO
messages.
Log an INFO
message.
message
The message to log; does not need to be a String.
progname
In the block form, this is the progname
to use in the log message. The default can be set with progname=
.
block
Evaluates to the message to log. This is not evaluated unless the logger’s level is sufficient to log the message. This allows you to create potentially expensive logging messages that are only called when the logger is configured to show them.
logger.info("MainApp") { "Received connection from #{ip}" } # ... logger.info "Waiting for input from user" # ... logger.info { "User typed #{input}" }
You’ll probably stick to the second form above, unless you want to provide a program name (which you can do with progname=
as well).
See add
.
The index method is specialized to return the index as [row, column] It also accepts an optional selector
argument, see each
for details.
Matrix[ [1,2], [3,4] ].index(&:even?) # => [0, 1] Matrix[ [1,1], [1,1] ].index(1, :strict_lower) # => [1, 0]
Returns true
if this is an hermitian matrix. Raises an error if matrix is not square.
Returns true
if this is a normal matrix. Raises an error if matrix is not square.
Returns true
if this is a singular matrix.
Overrides Object#inspect