Set
the output style to canonical, or not.
Get the indentation level.
Set
the indentation level to level
. The level must be less than 10 and greater than 1.
Returns the exit status of the child for which PTY#check raised this exception
The scanner’s state of the current token. This value is the bitwise OR of zero or more of the Ripper::EXPR_*
constants.
returns the socket family as an integer.
p Socket::AncillaryData.new(:INET6, :IPV6, :PKTINFO, "").family #=> 10
returns the cmsg data as a string.
p Socket::AncillaryData.new(:INET6, :IPV6, :PKTINFO, "").data #=> ""
returns the timestamp as a time object.
ancillarydata should be one of following type:
SOL_SOCKET/SCM_TIMESTAMP (microsecond) GNU/Linux, FreeBSD, NetBSD, OpenBSD, Solaris, MacOS X
SOL_SOCKET/SCM_TIMESTAMPNS (nanosecond) GNU/Linux
SOL_SOCKET/SCM_BINTIME (2**(-64) second) FreeBSD
Addrinfo.udp
(“127.0.0.1”, 0).bind {|s1|
Addrinfo.udp("127.0.0.1", 0).bind {|s2| s1.setsockopt(:SOCKET, :TIMESTAMP, true) s2.send "a", 0, s1.local_address ctl = s1.recvmsg.last p ctl #=> #<Socket::AncillaryData: INET SOCKET TIMESTAMP 2009-02-24 17:35:46.775581> t = ctl.timestamp p t #=> 2009-02-24 17:35:46 +0900 p t.usec #=> 775581 p t.nsec #=> 775581000 }
}
Returns the destination address of ifaddr. nil is returned if the flags doesn’t have IFF_POINTOPOINT.
Sends the String
msg
to the source
returns the socket family as an integer.
p Socket::Option.new(:INET6, :IPV6, :RECVPKTINFO, [1].pack("i!")).family #=> 10
returns the socket option data as a string.
p Socket::Option.new(:INET6, :IPV6, :RECVPKTINFO, [1].pack("i!")).data #=> "\x01\x00\x00\x00"
return values as an array
Returns true if argument is optional.
tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Workbook') method = WIN32OLE::Method.new(tobj, 'SaveAs') param1 = method.params[0] puts "#{param1.name} #{param1.optional?}" # => Filename true
Returns true if argument is return value.
tobj = WIN32OLE::Type.new('DirectX 7 for Visual Basic Type Library', 'DirectPlayLobbyConnection') method = WIN32OLE::Method.new(tobj, 'GetPlayerShortName') param = method.params[0] puts "#{param.name} #{param.retval?}" # => name true
Returns value if value is exists. If the value does not exist, this method returns nil.
tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') variables = tobj.variables variables.each do |variable| puts "#{variable.name} #{variable.value}" end The result of above script is following: xlChart = -4109 xlDialogSheet = -4116 xlExcel4IntlMacroSheet = 4 xlExcel4MacroSheet = 3 xlWorksheet = -4167
Returns Ruby object value from OLE variant.
obj = WIN32OLE::Variant.new(1, WIN32OLE::VARIANT::VT_BSTR) obj.value # => "1" (not Integer object, but String object "1")
Sets variant value to val. If the val type does not match variant value type(vartype), then val is changed to match variant value type(vartype) before setting val. This method is not available when vartype is VT_ARRAY(except VT_UI1|VT_ARRAY). If the vartype is VT_UI1|VT_ARRAY, the val should be String
object.
obj = WIN32OLE::Variant.new(1) # obj.vartype is WIN32OLE::VARIANT::VT_I4 obj.value = 3.2 # 3.2 is changed to 3 when setting value. p obj.value # => 3
Total number of input bytes read so far.
Total number of output bytes output so far.
Reads at most maxlen bytes from the gziped 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.
Returns true
if stat is writable by the effective user id of this process.
File.stat("testfile").writable? #=> true
Returns true
if stat is executable or if the operating system doesn’t distinguish executable files from nonexecutable files. The tests are made using the effective owner of the process.
File.stat("testfile").executable? #=> false
Returns whether the buffer buffer is accessible.
A buffer becomes invalid if it is a slice of another buffer (or string) which has been freed or re-allocated at a different address.
If the buffer was freed with free
, transferred with transfer
, or was never allocated in the first place.
buffer = IO::Buffer.new(0) buffer.null? #=> true buffer = IO::Buffer.new(4) buffer.null? #=> false buffer.free buffer.null? #=> true