Returns the name of the method.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') method = WIN32OLE_METHOD.new(tobj, 'SaveAs') puts method.name # => SaveAs
Returns name.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') method = WIN32OLE_METHOD.new(tobj, 'SaveAs') param1 = method.params[0] puts param1.name # => Filename
Returns Ruby Hash
object which represents VT_RECORD variable. The keys of Hash
object are member names of VT_RECORD OLE variable and the values of Hash
object are values of VT_RECORD OLE variable.
If COM server in VB.NET ComServer project is the following:
Imports System.Runtime.InteropServices Public Class ComClass Public Structure Book <MarshalAs(UnmanagedType.BStr)> _ Public title As String Public cost As Integer End Structure Public Function getBook() As Book Dim book As New Book book.title = "The Ruby Book" book.cost = 20 Return book End Function End Class
then, the result of WIN32OLE_RECORD#to_h is the following:
require 'win32ole' obj = WIN32OLE.new('ComServer.ComClass') book = obj.getBook book.to_h # => {"title"=>"The Ruby Book", "cost"=>20}
Returns OLE type name.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') puts tobj.name # => Application
Returns the type library name.
tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library') name = tlib.name # -> 'Microsoft Excel 9.0 Object Library'
Returns the name of variable.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') variables = tobj.variables variables.each do |variable| puts "#{variable.name}" end The result of above script is following: xlChart xlDialogSheet xlExcel4IntlMacroSheet xlExcel4MacroSheet xlWorksheet
Short representation of the buffer. It includes the address, size and symbolic flags. This format is subject to change.
puts IO::Buffer.new(4) # uses to_s internally # #<IO::Buffer 0x000055769f41b1a0+4 INTERNAL>
Returns an Array
with 14 elements representing the instruction sequence with the following data:
A string identifying the data format. Always YARVInstructionSequence/SimpleDataFormat
.
The major version of the instruction sequence.
The minor version of the instruction sequence.
A number identifying the data format. Always 1.
A hash containing:
:arg_size
the total number of arguments taken by the method or the block (0 if iseq doesn’t represent a method or block)
:local_size
the number of local variables + 1
:stack_max
used in calculating the stack depth at which a SystemStackError
is thrown.
label
The name of the context (block, method, class, module, etc.) that this instruction sequence belongs to.
<main>
if it’s at the top level, <compiled>
if it was evaluated from a string.
path
The relative path to the Ruby file where the instruction sequence was loaded from.
<compiled>
if the iseq was evaluated from a string.
absolute_path
The absolute path to the Ruby file where the instruction sequence was loaded from.
nil
if the iseq was evaluated from a string.
first_lineno
The number of the first source line where the instruction sequence was loaded from.
The type of the instruction sequence.
Valid values are :top
, :method
, :block
, :class
, :rescue
, :ensure
, :eval
, :main
, and plain
.
An array containing the names of all arguments and local variables as symbols.
An Hash
object containing parameter information.
More info about these values can be found in vm_core.h
.
A list of exceptions and control flow operators (rescue, next, redo, break, etc.).
An array of arrays containing the instruction names and operands that make up the body of the instruction sequence.
Note that this format is MRI specific and version dependent.
Same as format
.
Returns a new 6-element array, consisting of the label, user CPU time, system CPU time, children’s user CPU time, children’s system CPU time and elapsed real time.
Returns a hash containing the same data as ‘to_a`.
Convert the Cookie
to its string representation.
Returns the new Hash formed by adding each header-value pair in self
as a key-value pair in the Hash.
source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n" table = CSV.parse(source, headers: true) row = table[0] row.to_h # => {"Name"=>"foo", "Value"=>"0"}
Header order is preserved, but repeated headers are ignored:
source = "Name,Name,Name\nFoo,Bar,Baz\n" table = CSV.parse(source, headers: true) row = table[0] row.to_h # => {"Name"=>"Foo"}
Returns the table as an Array of Arrays; the headers are in the first row:
source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n" table = CSV.parse(source, headers: true) table.to_a # => [["Name", "Value"], ["foo", "0"], ["bar", "1"], ["baz", "2"]]