Results for: "String#[]"

Translates str in place, using the same rules as String#tr. Returns str, or nil if no changes were made.

Returns the element of WIN32OLE_VARIANT object(OLE array). This method is available only when the variant type of WIN32OLE_VARIANT object is VT_ARRAY.

REMARK:

The all indices should be 0 or natural number and
lower than or equal to max indices.
(This point is different with Ruby Array indices.)

obj = WIN32OLE_VARIANT.new([[1,2,3],[4,5,6]])
p obj[0,0] # => 1
p obj[1,0] # => 4
p obj[2,0] # => WIN32OLERuntimeError
p obj[0, -1] # => WIN32OLERuntimeError

USE OF RIPPER LIBRARY ONLY.

Strips up to width leading whitespaces from input, and returns the stripped column width.

USE OF RIPPER LIBRARY ONLY.

Strips up to width leading whitespaces from input, and returns the stripped column width.

Returns a string containing the IP address representation in canonical form.

No documentation available

Get the address as an Integer for the function named name. The function is searched via dlsym on RTLD_NEXT.

See man(3) dlsym() for more info.

Get the address as an Integer for the function named name.

See Fiddle::CompositeHandler.sym

Fetch struct member name if only one argument is specified. If two arguments are specified, the first is an offset and the second is a length and this method returns the string of length bytes beginning at offset.

Examples:

my_struct = struct(['int id']).malloc
my_struct.id = 1
my_struct['id'] # => 1
my_struct[0, 4] # => "\x01\x00\x00\x00".b

Get the underlying pointer for ruby object val and return it as a Fiddle::Pointer object.

Returns integer stored at index.

If start and length are given, a string containing the bytes from start of length will be returned.

No documentation available

Gets all key-value pairs in a specific section from the current configuration.

Given the following configurating file being loaded:

config = OpenSSL::Config.load('foo.cnf')
  #=> #<OpenSSL::Config sections=["default"]>
puts config.to_s
  #=> [ default ]
  #   foo=bar

You can get a hash of the specific section like so:

config['default']
  #=> {"foo"=>"bar"}
No documentation available

Read a registry value named name and return its value data. The class of the value is the same as the read method returns.

If the value type is REG_EXPAND_SZ, returns value data whose environment variables are replaced. If the value type is neither REG_SZ, REG_MULTI_SZ, REG_DWORD, REG_DWORD_BIG_ENDIAN, nor REG_QWORD, TypeError is raised.

The meaning of rtype is the same as for the read method.

Retrieves a weakly referenced object with the given key

Retrieve the session data for key key.

No documentation available

Returns data from the table; does not modify the table.


Fetch a Row by Its Integer Index

Returns the nth row of the table if that row exists:

source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
table = CSV.parse(source, headers: true)
table.by_row! # => #<CSV::Table mode:row row_count:4>
table[1] # => #<CSV::Row "Name":"bar" "Value":"1">
table.by_col_or_row! # => #<CSV::Table mode:col_or_row row_count:4>
table[1] # => #<CSV::Row "Name":"bar" "Value":"1">

Counts backward from the last row if n is negative:

table[-1] # => #<CSV::Row "Name":"baz" "Value":"2">

Returns nil if n is too large or too small:

table[4] # => nil
table[-4] # => nil

Raises an exception if the access mode is :row and n is not an Integer:

table.by_row! # => #<CSV::Table mode:row row_count:4>
# Raises TypeError (no implicit conversion of String into Integer):
table['Name']

Fetch a Column by Its Integer Index

Returns the nth column of the table if that column exists:

source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
table = CSV.parse(source, headers: true)
table.by_col! # => #<CSV::Table mode:col row_count:4>
table[1] # => ["0", "1", "2"]

Counts backward from the last column if n is negative:

table[-2] # => ["foo", "bar", "baz"]

Returns an Array of nil fields if n is too large or too small:

table[4] # => [nil, nil, nil]
table[-4] # => [nil, nil, nil]

Fetch Rows by Range

Returns rows from the table, beginning at row range.first, if those rows exist:

source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
table = CSV.parse(source, headers: true)
table.by_row! # => #<CSV::Table mode:row row_count:4>
rows = table[1..2] # => #<CSV::Row "Name":"bar" "Value":"1">
rows # => [#<CSV::Row "Name":"bar" "Value":"1">, #<CSV::Row "Name":"baz" "Value":"2">]
table.by_col_or_row! # => #<CSV::Table mode:col_or_row row_count:4>
rows = table[1..2] # => #<CSV::Row "Name":"bar" "Value":"1">
rows # => [#<CSV::Row "Name":"bar" "Value":"1">, #<CSV::Row "Name":"baz" "Value":"2">]

If there are too few rows, returns all from range.start to the end:

rows = table[1..50] # => #<CSV::Row "Name":"bar" "Value":"1">
rows # => [#<CSV::Row "Name":"bar" "Value":"1">, #<CSV::Row "Name":"baz" "Value":"2">]

Special case: if range.start == table.size, returns an empty Array:

table[table.size..50] # => []

If range.end is negative, calculates the ending index from the end:

rows = table[0..-1]
rows # => [#<CSV::Row "Name":"foo" "Value":"0">, #<CSV::Row "Name":"bar" "Value":"1">, #<CSV::Row "Name":"baz" "Value":"2">]

If range.start is negative, calculates the starting index from the end:

rows = table[-1..2]
rows # => [#<CSV::Row "Name":"baz" "Value":"2">]

If range.start is larger than table.size, returns nil:

table[4..4] # => nil

Fetch Columns by Range

Returns column values from the table, if the column exists; the values are arranged by row:

source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
table = CSV.parse(source, headers: true)
table.by_col!
table[0..1] # => [["foo", "0"], ["bar", "1"], ["baz", "2"]]

Special case: if range.start == headers.size, returns an Array (size: table.size) of empty Arrays:

table[table.headers.size..50] # => [[], [], []]

If range.end is negative, calculates the ending index from the end:

table[0..-1] # => [["foo", "0"], ["bar", "1"], ["baz", "2"]]

If range.start is negative, calculates the starting index from the end:

table[-2..2] # => [["foo", "0"], ["bar", "1"], ["baz", "2"]]

If range.start is larger than table.size, returns an Array of nil values:

table[4..4] # => [nil, nil, nil]

Fetch a Column by Its String Header

Returns column values from the table, if the column exists:

source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
table = CSV.parse(source, headers: true)
table.by_col! # => #<CSV::Table mode:col row_count:4>
table['Name'] # => ["foo", "bar", "baz"]
table.by_col_or_row! # => #<CSV::Table mode:col_or_row row_count:4>
col = table['Name']
col # => ["foo", "bar", "baz"]

Modifying the returned column values does not modify the table:

col[0] = 'bat'
col # => ["bat", "bar", "baz"]
table['Name'] # => ["foo", "bar", "baz"]

Returns an Array of nil values if there is no such column:

table['Nosuch'] # => [nil, nil, nil]

Retrieves key from the GW

No documentation available
No documentation available
No documentation available
No documentation available
Search took: 3ms  ·  Total Results: 2723