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:
This visitor walks through the tree and copies each node as it is being visited. This is useful for consumers that want to mutate the tree, as you can change subtrees in place without effecting the rest of the tree.
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 } }
The Reflection
module provides the ability to reflect on the structure of the syntax tree itself, as opposed to looking at a single syntax tree. This is useful in metaprogramming contexts.
Module
that defines the default UserInteraction
. Any class including this module will have access to the ui
method that returns the default UI.
Represents an alternation pattern in pattern matching.
foo => bar | baz ^^^^^^^^^
Represents an optional keyword parameter to a method, block, or lambda definition.
def a(b: 1) ^^^^ end
Represents an optional parameter to a method, block, or lambda definition.
def a(b = 1) ^^^^^ end
Potentially raised when a specification is validated.
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.
Mixin methods for local and remote Gem::Command
options.
An Encoding instance represents a character encoding usable in Ruby. It is defined as a constant under the Encoding namespace. It has a name and, optionally, aliases:
Encoding::US_ASCII.name # => "US-ASCII" Encoding::US_ASCII.names # => ["US-ASCII", "ASCII", "ANSI_X3.4-1968", "646"]
A Ruby method that accepts an encoding as an argument will accept:
An Encoding object.
The name of an encoding.
An alias for an encoding name.
These are equivalent:
'foo'.encode(Encoding::US_ASCII) # Encoding object. 'foo'.encode('US-ASCII') # Encoding name. 'foo'.encode('ASCII') # Encoding alias.
For a full discussion of encodings and their uses, see the Encodings document.
Encoding::ASCII_8BIT is a special-purpose encoding that is usually used for a string of bytes, not a string of characters. But as the name indicates, its characters in the ASCII range are considered as ASCII characters. This is useful when you use other ASCII-compatible encodings.
Raised when a feature is not implemented on the current platform. For example, methods depending on the fsync
or fork
system calls may raise this exception if the underlying operating system or Ruby runtime does not support them.
Note that if fork
raises a NotImplementedError
, then respond_to?(:fork)
returns false
.
EncodingError
is the base class for encoding errors.
Use the Monitor
class when you want to have a lock object for blocks with mutual exclusion.
require 'monitor' lock = Monitor.new lock.synchronize do # exclusive access end