Results for: "Array.new"

Returns an initialized Tms object which has utime as the user CPU time, stime as the system CPU time, cutime as the children’s user CPU time, cstime as the children’s system CPU time, real as the elapsed real time and label as the label.

Create a new CGI::Cookie object.

name_string

The name of the cookie; in this form, there is no domain or expiration. The path is gleaned from the SCRIPT_NAME environment variable, and secure is false.

*value

value or list of values of the cookie

options_hash

A Hash of options to initialize this Cookie. Possible options are:

name

the name of the cookie. Required.

value

the cookie’s value or list of values.

path

the path for which this cookie applies. Defaults to the value of the SCRIPT_NAME environment variable.

domain

the domain for which this cookie applies.

expires

the time at which this cookie expires, as a Time object.

secure

whether this cookie is a secure cookie or not (default to false). Secure cookies are only transmitted to HTTPS servers.

httponly

whether this cookie is a HttpOnly cookie or not (default to

false).  HttpOnly cookies are not available to javascript.

These keywords correspond to attributes of the cookie object.

Create a new CGI::Session object for request.

request is an instance of the CGI class (see cgi.rb). option is a hash of options for initialising this CGI::Session instance. The following options are recognised:

session_key

the parameter name used for the session id. Defaults to ‘_session_id’.

session_id

the session id to use. If not provided, then it is retrieved from the session_key parameter of the request, or automatically generated for a new session.

new_session

if true, force creation of a new session. If not set, a new session is only created if none currently exists. If false, a new session is never created, and if none currently exists and the session_id option is not set, an ArgumentError is raised.

database_manager

the name of the class providing storage facilities for session state persistence. Built-in support is provided for FileStore (the default), MemoryStore, and PStore (from cgi/session/pstore.rb). See the documentation for these classes for more details.

The following options are also recognised, but only apply if the session id is stored in a cookie.

session_expires

the time the current session expires, as a Time object. If not set, the session will terminate when the user’s browser is closed.

session_domain

the hostname domain for which this session is valid. If not set, defaults to the hostname of the server.

session_secure

if true, this session will only work over HTTPS.

session_path

the path for which this session applies. Defaults to the directory of the CGI script.

option is also passed on to the session storage class initializer; see the documentation for each session storage class for the options they support.

The retrieved or created session is automatically added to request as a cookie, and also to its output_hidden table, which is used to add hidden input elements to forms.

WARNING the output_hidden fields are surrounded by a <fieldset> tag in HTML 4 generation, which is not invisible on many browsers; you may wish to disable the use of fieldsets with code similar to the following (see blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/37805)

cgi = CGI.new("html4")
class << cgi
    undef_method :fieldset
end
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.

Search took: 4ms  ·  Total Results: 2278