Results for: "Array"

Example:

x += 1
     ^

def foo(…); end

^^^

def foo(…); end

^^^

Parse a rational from the string representation.

Clear the reference to the object this is pinning.

Returns true if the reference has been cleared, otherwise returns false.

No documentation available

Generates a cryptographically strong pseudo-random number of bits.

See also the man page BN_rand(3).

Parses a given string as a blob that contains configuration for OpenSSL.

No documentation available

Emit a scalar with value

Called when a scalar value is found. The scalar may have an anchor, a tag, be implicitly plain or implicitly quoted

value is the string value of the scalar anchor is an associated anchor or nil tag is an associated tag or nil plain is a boolean value quoted is a boolean value style is an integer indicating the string style

See the constants in Psych::Nodes::Scalar for the possible values of style

Example

Here is a YAML document that exercises most of the possible ways this method can be called:

---
- !str "foo"
- &anchor fun
- many
  lines
- |
  many
  newlines

The above YAML document contains a list with four strings. Here are the parameters sent to this method in the same order:

# value               anchor    tag     plain   quoted  style
["foo",               nil,      "!str", false,  false,  3    ]
["fun",               "anchor", nil,    true,   false,  1    ]
["many lines",        nil,      nil,    true,   false,  1    ]
["many\nnewlines\n",  nil,      nil,    false,  true,   4    ]

Parse the YAML document contained in yaml. Events will be called on the handler set on the parser instance.

See Psych::Parser and Psych::Parser#handler

Returns a Psych::Parser::Mark object that contains line, column, and index information.

No documentation available

Emit a scalar with value, anchor, tag, and a plain or quoted string type with style.

See Psych::Handler#scalar

Starts the parser. init is a data accumulator and is passed to the next event handler (as of Enumerable#inject).

Returns array of WIN32OLE::Variable objects which represent variables defined in OLE class.

tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'XlSheetType')
vars = tobj.variables
vars.each do |v|
  puts "#{v.name} = #{v.value}"
end

The result of above sample script is follows:
  xlChart = -4109
  xlDialogSheet = -4116
  xlExcel4IntlMacroSheet = 4
  xlExcel4MacroSheet = 3
  xlWorksheet = -4167

Returns the number which represents variable kind.

tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'XlSheetType')
variables = tobj.variables
variables.each do |variable|
  puts "#{variable.name} #{variable.varkind}"
end

The result of above script is following:
   xlChart 2
   xlDialogSheet 2
   xlExcel4IntlMacroSheet 2
   xlExcel4MacroSheet 2
   xlWorksheet 2

Returns OLE variant type.

obj = WIN32OLE::Variant.new("string")
obj.vartype # => WIN32OLE::VARIANT::VT_BSTR

Creates a GzipReader or GzipWriter associated with io, passing in any necessary extra options, and executes the block with the newly created object just like File.open.

The GzipFile object will be closed automatically after executing the block. If you want to keep the associated IO object open, you may call Zlib::GzipFile#finish method in the block.

Reads at most maxlen bytes from the gzipped stream but it blocks only if gzipreader has no data immediately available. If the optional outbuf argument is present, it must reference a String, which will receive the data. It raises EOFError on end of file.

See Zlib::GzipReader documentation for a description.

Returns true if the file is a character device, false if it isn’t or if the operating system doesn’t support this feature.

File.stat("/dev/tty").chardev?   #=> true

Transfers ownership of the underlying memory to a new buffer, causing the current buffer to become uninitialized.

buffer = IO::Buffer.new('test')
other = buffer.transfer
other
# =>
# #<IO::Buffer 0x00007f136a15f7b0+4 SLICE>
# 0x00000000  74 65 73 74                                     test
buffer
# =>
# #<IO::Buffer 0x0000000000000000+0 NULL>
buffer.null?
# => true
Search took: 4ms  ·  Total Results: 2478