Returns true
if this is a header row, false
otherwise.
Returns true
if this is a field row, false
otherwise.
Returns a duplicate of self
, in row mode (see Row Mode):
source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n" table = CSV.parse(source, headers: true) table.mode # => :col_or_row dup_table = table.by_row dup_table.mode # => :row dup_table.equal?(table) # => false # It's a dup
This may be used to chain method calls without changing the mode (but also will affect performance and memory usage):
dup_table.by_row[1]
Also note that changes to the duplicate table will not affect the original.
Sets the mode for self
to row mode (see Row Mode); returns self
:
source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n" table = CSV.parse(source, headers: true) table.mode # => :col_or_row table1 = table.by_row! table.mode # => :row table1.equal?(table) # => true # Returned self
Gets the body text from the target and outputs it to $stdout. The target can either be specified as (uri
, headers
), or as (host
, path
, port
= 80); so:
Net::HTTP.get_print URI('http://www.example.com/index.html')
or:
Net::HTTP.get_print 'www.example.com', '/index.html'
you can also specify request headers:
Net::HTTP.get_print URI('http://www.example.com/index.html'), { 'Accept' => 'text/html' }
for debug
for debug
Creates a socket at address
If address
is multicast address then interface_address
and multicast_interface
can be set as optional.
A created socket is bound to interface_address
. If you use IPv4 multicast then the interface of interface_address
is used as the inbound interface. If interface_address
is omitted or nil then ‘0.0.0.0’ or ‘::1’ is used.
If you use IPv6 multicast then multicast_interface
is used as the inbound interface. multicast_interface
is a network interface index. If multicast_interface
is omitted then 0 (default interface) is used.