Returns the type library file path.
tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library') classes = tlib.ole_types.collect{|k| k.name} # -> ['AddIn', 'AddIns' ...]
Returns the type library file path.
tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library') classes = tlib.ole_types.collect{|k| k.name} # -> ['AddIn', 'AddIns' ...]
Returns OLE type string.
tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') variables = tobj.variables variables.each do |variable| puts "#{variable.ole_type} #{variable.name}" end The result of above script is following: INT xlChart INT xlDialogSheet INT xlExcel4IntlMacroSheet INT xlExcel4MacroSheet INT xlWorksheet
Returns variable kind string.
tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') variables = tobj.variables variables.each do |variable| puts "#{variable.name} #{variable.variable_kind}" end The result of above script is following: xlChart CONSTANT xlDialogSheet CONSTANT xlExcel4IntlMacroSheet CONSTANT xlExcel4MacroSheet CONSTANT xlWorksheet CONSTANT
Returns OS code number recorded in the gzip file header.
Returns true
if stat is readable by the real user id of this process.
File.stat("testfile").readable_real? #=> true
If stat is readable by others, returns an integer representing the file permission bits of stat. Returns nil
otherwise. The meaning of the bits is platform dependent; on Unix systems, see stat(2)
.
m = File.stat("/etc/passwd").world_readable? #=> 420 sprintf("%o", m) #=> "644"
Returns true
if stat is writable by the real user id of this process.
File.stat("testfile").writable_real? #=> true
If stat is writable by others, returns an integer representing the file permission bits of stat. Returns nil
otherwise. The meaning of the bits is platform dependent; on Unix systems, see stat(2)
.
m = File.stat("/tmp").world_writable? #=> 511 sprintf("%o", m) #=> "777"
Same as executable?
, but tests using the real owner of the process.
Takes source
, which can be a string of Ruby code, or an open File
object. that contains Ruby source code. It parses and compiles using prism.
Optionally takes file
, path
, and line
which describe the file path, real path and first line number of the ruby code in source
which are metadata attached to the returned iseq
.
file
is used for ‘__FILE__` and exception backtrace. path
is used for require_relative
base. It is recommended these should be the same full path.
options
, which can be true
, false
or a Hash
, is used to modify the default behavior of the Ruby iseq compiler.
For details regarding valid compile options see ::compile_option=
.
RubyVM::InstructionSequence.compile("a = 1 + 2") #=> <RubyVM::InstructionSequence:<compiled>@<compiled>> path = "test.rb" RubyVM::InstructionSequence.compile(File.read(path), path, File.expand_path(path)) #=> <RubyVM::InstructionSequence:<compiled>@test.rb:1> file = File.open("test.rb") RubyVM::InstructionSequence.compile(file) #=> <RubyVM::InstructionSequence:<compiled>@<compiled>:1> path = File.expand_path("test.rb") RubyVM::InstructionSequence.compile(File.read(path), path, path) #=> <RubyVM::InstructionSequence:<compiled>@/absolute/path/to/test.rb:1>
Returns integer 80
, the default port to use for HTTP requests:
Net::HTTP.default_port # => 80
Sets the body stream for the request:
req = Net::HTTP::Post.new(uri) # => #<Net::HTTP::Post POST> req.body_stream # => nil require 'stringio' req.body_stream = StringIO.new('xyzzy') # => #<StringIO:0x0000027d1e5affa8> req.body_stream # => #<StringIO:0x0000027d1e5affa8>
true if the response has a body.
Gets the entity body returned by the remote HTTP server.
If a block is given, the body is passed to the block, and the body is provided in fragments, as it is read in from the socket.
If dest
argument is given, response is read into that variable, with dest#<<
method (it could be String
or IO
, or any other object responding to <<
).
Calling this method a second or subsequent time for the same HTTPResponse
object will return the value already read.
http.request_get('/index.html') {|res| puts res.read_body } http.request_get('/index.html') {|res| p res.read_body.object_id # 538149362 p res.read_body.object_id # 538149362 } # using iterator http.request_get('/index.html') {|res| res.read_body do |segment| print segment end }
Validates typecode v
, returns true
or false
.
def child_nodes
: () -> Array[nil | Node]
def child_nodes
: () -> Array[nil | Node]
def child_nodes
: () -> Array[nil | Node]