Results for: "module_function"

Raised when a signal is received.

begin
  Process.kill('HUP',Process.pid)
  sleep # wait for receiver to handle signal sent by Process.kill
rescue SignalException => e
  puts "received Exception #{e}"
end

produces:

received Exception SIGHUP
No documentation available
No documentation available

Raised when attempting to divide an integer by 0.

42 / 0   #=> ZeroDivisionError: divided by 0

Note that only division by an exact 0 will raise the exception:

42 /  0.0   #=> Float::INFINITY
42 / -0.0   #=> -Float::INFINITY
0  /  0.0   #=> NaN

Ruby supports two forms of objectified methods. Class Method is used to represent methods that are associated with a particular object: these method objects are bound to that object. Bound method objects for an object can be created using Object#method.

Ruby also supports unbound methods; methods objects that are not associated with a particular object. These can be created either by calling Module#instance_method or by calling unbind on a bound method object. The result of both of these is an UnboundMethod object.

Unbound methods can only be called after they are bound to an object. That object must be a kind_of? the method’s original class.

class Square
  def area
    @side * @side
  end
  def initialize(side)
    @side = side
  end
end

area_un = Square.instance_method(:area)

s = Square.new(12)
area = area_un.bind(s)
area.call   #=> 144

Unbound methods are a reference to the method at the time it was objectified: subsequent changes to the underlying class will not affect the unbound method.

class Test
  def test
    :original
  end
end
um = Test.instance_method(:test)
class Test
  def test
    :modified
  end
end
t = Test.new
t.test            #=> :modified
um.bind(t).call   #=> :original

Response class for Unavailable For Legal Reasons responses (status code 451).

A server operator has received a legal demand to deny access to a resource or to a set of resources that includes the requested resource.

References:

No documentation available
No documentation available

Helper methods for both Gem::Installer and Gem::Uninstaller

No documentation available

FIXME: This isn’t documented in Nutshell.

Since MonitorMixin.new_cond returns a ConditionVariable, and the example above calls while_wait and signal, this class should be documented.

Response class for Precondition Failed responses (status code 412).

The server does not meet one of the preconditions specified in the request headers.

References:

Response class for Expectation Failed responses (status code 417).

The server cannot meet the requirements of the Expect request-header field.

References:

ConditionVariable objects augment class Mutex. Using condition variables, it is possible to suspend while in the middle of a critical section until a resource becomes available.

Example:

mutex = Thread::Mutex.new
resource = Thread::ConditionVariable.new

a = Thread.new {
   mutex.synchronize {
     # Thread 'a' now needs the resource
     resource.wait(mutex)
     # 'a' can now have the resource
   }
}

b = Thread.new {
   mutex.synchronize {
     # Thread 'b' has finished using the resource
     resource.signal
   }
}

Module that defines the default UserInteraction. Any class including this module will have access to the ui method that returns the default UI.

No documentation available
No documentation available

Potentially raised when a specification is validated.

No documentation available

Represents an error communicating via HTTP.

Raised by Resolver when a dependency requests a gem for which there is no spec.

Keyword completion module. This allows partial arguments to be specified and resolved against a list of acceptable values.

No documentation available

Mixin methods for local and remote Gem::Command options.

No documentation available
Search took: 7ms  ·  Total Results: 3609