Results for: "module_function"

Returns a canonical string representation of time.

Time.now.asctime   #=> "Wed Apr  9 08:56:03 2003"
Time.now.ctime     #=> "Wed Apr  9 08:56:03 2003"

Returns the values for this struct as an Array.

Customer = Struct.new(:name, :address, :zip)
joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
joe.to_a[1]   #=> "123 Maple, Anytown NC"

Provides a mechanism for issuing low-level commands to control or query I/O devices. Arguments and results are platform dependent. If arg is a number, its value is passed directly. If it is a string, it is interpreted as a binary sequence of bytes. On Unix platforms, see ioctl(2) for details. Not implemented on all platforms.

No documentation available

Returns the last change time, using directory information, not the file itself.

See File.ctime.

Truncates the file to length bytes.

See File.truncate.

Requests a connection to be made on the given remote_sockaddr. Returns 0 if successful, otherwise an exception is raised.

Parameter

Example:

# Pull down Google's web page
require 'socket'
include Socket::Constants
socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
sockaddr = Socket.pack_sockaddr_in( 80, 'www.google.com' )
socket.connect( sockaddr )
socket.write( "GET / HTTP/1.0\r\n\r\n" )
results = socket.read

Unix-based Exceptions

On unix-based systems the following system exceptions may be raised if the call to connect fails:

On unix-based systems if the address family of the calling socket is AF_UNIX the follow exceptions may be raised if the call to connect fails:

Windows Exceptions

On Windows systems the following system exceptions may be raised if the call to connect fails:

See

creates a socket connected to the address of self.

The optional argument opts is options represented by a hash. opts may have following options:

:timeout

specify the timeout in seconds.

If a block is given, it is called with the socket and the value of the block is returned. The socket is returned otherwise.

Addrinfo.tcp("www.ruby-lang.org", 80).connect {|s|
  s.print "GET / HTTP/1.0\r\nHost: www.ruby-lang.org\r\n\r\n"
  puts s.read
}

Connects udpsocket to host:port.

This makes possible to send without destination address.

u1 = UDPSocket.new
u1.bind("127.0.0.1", 4913)
u2 = UDPSocket.new
u2.connect("127.0.0.1", 4913)
u2.send "uuuu", 0
p u1.recvfrom(10) #=> ["uuuu", ["AF_INET", 33230, "localhost", "127.0.0.1"]]

Truncates the buffer string to at most integer bytes. The stream must be opened for writing.

Appends str to the string being scanned. This method does not affect scan pointer.

s = StringScanner.new("Fri Dec 12 1975 14:39")
s.scan(/Fri /)
s << " +1000 GMT"
s.string            # -> "Fri Dec 12 1975 14:39 +1000 GMT"
s.scan(/Dec/)       # -> "Dec"

Returns running OLE Automation object or WIN32OLE object from moniker. 1st argument should be OLE program id or class id or moniker.

WIN32OLE.connect('Excel.Application') # => WIN32OLE object which represents running Excel.

Returns the type library version.

tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
puts tlib.version #-> "1.3"
No documentation available

Returns revision information for the erb.rb module.

Version

Obtains a lock, runs the block, and releases the lock when the block completes. See the example under Mutex.

No documentation available
No documentation available
No documentation available

Task description for the clobber rdoc task or its renamed equivalent

Task description for the rdoc task or its renamed equivalent

Task description for the rerdoc task or its renamed description

Establishes proc on thr as the handler for tracing, or disables tracing if the parameter is nil.

See Kernel#set_trace_func.

Adds proc as a handler for tracing.

See Thread#set_trace_func and Kernel#set_trace_func.

Search took: 6ms  ·  Total Results: 3202