Results for: "Array.new"

No documentation available

A CSV::FieldsConverter is a data structure for storing the fields converter properties to be passed as a parameter when parsing a new file (e.g. CSV::Parser.new(@io, parser_options))

No documentation available

Returns the new CSV::Row instance constructed from arguments headers and fields; both should be Arrays; note that the fields need not be Strings:

row = CSV::Row.new(['Name', 'Value'], ['foo', 0])
row # => #<CSV::Row "Name":"foo" "Value":0>

If the Array lengths are different, the shorter is nil-filled:

row = CSV::Row.new(['Name', 'Value', 'Date', 'Size'], ['foo', 0])
row # => #<CSV::Row "Name":"foo" "Value":0 "Date":nil "Size":nil>

Each CSV::Row object is either a field row or a header row; by default, a new row is a field row; for the row created above:

row.field_row? # => true
row.header_row? # => false

If the optional argument header_row is given as true, the created row is a header row:

row = CSV::Row.new(['Name', 'Value'], ['foo', 0], header_row = true)
row # => #<CSV::Row "Name":"foo" "Value":0>
row.field_row? # => false
row.header_row? # => true

Returns a new CSV::Table object.


Create an empty CSV::Table object:

table = CSV::Table.new([])
table # => #<CSV::Table mode:col_or_row row_count:1>

Create a non-empty CSV::Table object:

rows = [
  CSV::Row.new([], []),
  CSV::Row.new([], []),
  CSV::Row.new([], []),
]
table  = CSV::Table.new(rows)
table # => #<CSV::Table mode:col_or_row row_count:4>

If argument headers is an Array of Strings, those Strings become the table’s headers:

table = CSV::Table.new([], headers: ['Name', 'Age'])
table.headers # => ["Name", "Age"]

If argument headers is not given and the table has rows, the headers are taken from the first row:

rows = [
  CSV::Row.new(['Foo', 'Bar'], []),
  CSV::Row.new(['foo', 'bar'], []),
  CSV::Row.new(['FOO', 'BAR'], []),
]
table  = CSV::Table.new(rows)
table.headers # => ["Foo", "Bar"]

If argument headers is not given and the table is empty (has no rows), the headers are also empty:

table  = CSV::Table.new([])
table.headers # => []

Raises an exception if argument array_of_rows is not an Array object:

# Raises NoMethodError (undefined method `first' for :foo:Symbol):
CSV::Table.new(:foo)

Raises an exception if an element of array_of_rows is not a CSV::Table object:

# Raises NoMethodError (undefined method `headers' for :foo:Symbol):
CSV::Table.new([:foo])
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available

Creates a new entry using str.

str may be “*” or “all” to match any address, an IP address string to match a specific address, an IP address mask per IPAddr, or one containing “*” to match part of an IPv4 address.

IPAddr::InvalidPrefixError may be raised when an IP network address with an invalid netmask/prefix is given.

Creates an empty ACLList

Create a new DRbUnknownError for the DRb::DRbUnknown object unknown

Creates a new remote error that wraps the Exception error

Create a new DRbUnknown object.

buf is a string containing a marshalled object that could not be unmarshalled. err is the error message that was raised when the unmarshalling failed. It is used to determine the name of the unmarshalled object.

Creates a new DRbArray that either dumps or wraps all the items in the Array ary so they can be loaded by a remote DRb server.

Create a new remote object stub.

obj is the (local) object we want to create a stub for. Normally this is nil. uri is the URI of the remote object that this will be a stub for.

No documentation available

Create a new DRbServer instance.

uri is the URI to bind to. This is normally of the form ‘druby://<hostname>:<port>’ where <hostname> is a hostname of the local machine. If nil, then the system’s default hostname will be bound to, on a port selected by the system; these value can be retrieved from the uri attribute. ‘druby:’ specifies the default dRuby transport protocol: another protocol, such as ‘drbunix:’, can be specified instead.

front is the front object for the server, that is, the object to which remote method calls on the server will be passed. If nil, then the server will not accept remote method calls.

If config_or_acl is a hash, it is the configuration to use for this server. The following options are recognised:

:idconv

an id-to-object conversion object. This defaults to an instance of the class DRb::DRbIdConv.

:verbose

if true, all unsuccessful remote calls on objects in the server will be logged to $stdout. false by default.

:tcp_acl

the access control list for this server. See the ACL class from the main dRuby distribution.

:load_limit

the maximum message size in bytes accepted by the server. Defaults to 25 MB (26214400).

:argc_limit

the maximum number of arguments to a remote method accepted by the server. Defaults to 256.

The default values of these options can be modified on a class-wide basis by the class methods default_argc_limit, default_load_limit, default_acl, default_id_conv, and verbose=

If config_or_acl is not a hash, but is not nil, it is assumed to be the access control list for this server. See the :tcp_acl option for more details.

If no other server is currently set as the primary server, this will become the primary server.

The server will immediately start running in its own thread.

Create a new remote object stub.

obj is the (local) object we want to create a stub for. Normally this is nil. uri is the URI of the remote object that this will be a stub for.

Search took: 4ms  ·  Total Results: 2195