Looks up all IP address for name
.
Looks up the hostname of address
.
Looks up all hostnames for address
.
Looks up the first IP address for name
.
Looks up all IP address for name
.
Looks up the hostname of address
.
Looks up all hostnames for address
.
Closes the file. If unlink_now
is true, then the file will be unlinked (deleted) after closing. Of course, you can choose to later call unlink
if you do not unlink it now.
If you don’t explicitly unlink the temporary file, the removal will be delayed until the object is finalized.
Closes and unlinks (deletes) the file. Has the same effect as called close(true)
.
Returns the parameter information of this proc.
prc = lambda{|x, y=42, *other|} prc.parameters #=> [[:req, :x], [:opt, :y], [:rest, :other]]
Returns a clone of this method.
class A def foo return "bar" end end m = A.new.method(:foo) m.call # => "bar" n = m.clone.call # => "bar"
Returns the bound receiver of the method object.
(1..3).method(:map).receiver # => 1..3
Returns the class or module that defines the method. See also Method#receiver
.
(1..3).method(:map).owner #=> Enumerable
Returns the parameter information of this method.
def foo(bar); end method(:foo).parameters #=> [[:req, :bar]] def foo(bar, baz, bat, &blk); end method(:foo).parameters #=> [[:req, :bar], [:req, :baz], [:req, :bat], [:block, :blk]] def foo(bar, *args); end method(:foo).parameters #=> [[:req, :bar], [:rest, :args]] def foo(bar, baz, *args, &blk); end method(:foo).parameters #=> [[:req, :bar], [:req, :baz], [:rest, :args], [:block, :blk]]
Returns a clone of this method.
class A def foo return "bar" end end m = A.new.method(:foo) m.call # => "bar" n = m.clone.call # => "bar"
Returns the class or module that defines the method. See also Method#receiver
.
(1..3).method(:map).owner #=> Enumerable
Returns the parameter information of this method.
def foo(bar); end method(:foo).parameters #=> [[:req, :bar]] def foo(bar, baz, bat, &blk); end method(:foo).parameters #=> [[:req, :bar], [:req, :baz], [:req, :bat], [:block, :blk]] def foo(bar, *args); end method(:foo).parameters #=> [[:req, :bar], [:rest, :args]] def foo(bar, baz, *args, &blk); end method(:foo).parameters #=> [[:req, :bar], [:req, :baz], [:rest, :args], [:block, :blk]]
Prevents threads from being added to or removed from the receiving ThreadGroup
.
New threads can still be started in an enclosed ThreadGroup
.
ThreadGroup::Default.enclose #=> #<ThreadGroup:0x4029d914> thr = Thread.new { Thread.stop } #=> #<Thread:0x402a7210 sleep> tg = ThreadGroup.new #=> #<ThreadGroup:0x402752d4> tg.add thr #=> ThreadError: can't move from the enclosed thread group
Returns true
if the thgrp
is enclosed. See also ThreadGroup#enclose
.
Terminates thr
and schedules another thread to be run, returning the terminated Thread
. If this is the main thread, or the last thread, exits the process.
Returns true
if this lock is currently held by some thread.
Attempts to grab the lock and waits if it isn’t available. Raises ThreadError
if mutex
was locked by the current thread.
Releases the lock. Raises ThreadError
if mutex
wasn’t locked by the current thread.
Closes the queue. A closed queue cannot be re-opened.
After the call to close completes, the following are true:
closed?
will return true
close
will be ignored.
calling enq/push/<< will raise a ClosedQueueError
.
when empty?
is false, calling deq/pop/shift will return an object from the queue as usual.
when empty?
is true, deq(false) will not suspend the thread and will return nil. deq(true) will raise a ThreadError
.
ClosedQueueError
is inherited from StopIteration
, so that you can break loop block.
Example: q = Queue.new Thread.new{ while e = q.deq # wait for nil to break loop # ... end } q.close
Returns true
if the queue is closed.