Response class for Accepted
responses (status code 202).
The Accepted
response indicates that the server has received and is processing a request, but the processing has not yet been completed.
References:
Response class for Reset Content
responses (status code 205).
The Reset Content
response indicates that the server successfully processed the request, asks that the client reset its document view, and is not returning any content.
References:
Response class for See Other
responses (status code 303).
The response to the request can be found under another URI
using the GET method.
References:
Response class for Temporary Redirect
responses (status code 307).
The request should be repeated with another URI
; however, future requests should still use the original URI
.
References:
Response class for Payload Too Large
responses (status code 413).
The request is larger than the server is willing or able to process.
References:
Response class for Payload Too Large
responses (status code 413).
The request is larger than the server is willing or able to process.
References:
Response class for Unprocessable Entity
responses (status code 422).
The request was well-formed but had semantic errors.
References:
Response class for Request Header Fields Too Large
responses (status code 431).
An individual header field is too large, or all the header fields collectively, are too large.
References:
Response class for Service Unavailable
responses (status code 503).
The server cannot handle the request (because it is overloaded or down for maintenance).
References:
OpenTimeout
, a subclass of Timeout::Error
, is raised if a connection cannot be created within the open_timeout.
The writer adapter class
DesugarCompiler
is a compiler that desugars Ruby code into a more primitive form. This is useful for consumers that want to deal with fewer node types.
The dispatcher class fires events for nodes that are found while walking an AST to all registered listeners. It’s useful for performing different types of analysis on the AST while only having to walk the tree once.
To use the dispatcher, you would first instantiate it and register listeners for the events you’re interested in:
class OctalListener def on_integer_node_enter(node) if node.octal? && !node.slice.start_with?("0o") warn("Octal integers should be written with the 0o prefix") end end end listener = OctalListener.new dispatcher = Prism::Dispatcher.new dispatcher.register(listener, :on_integer_node_enter)
Then, you can walk any number of trees and dispatch events to the listeners:
result = Prism.parse("001 + 002 + 003") dispatcher.dispatch(result.value)
Optionally, you can also use ‘#dispatch_once` to dispatch enter and leave events for a single node without recursing further down the tree. This can be useful in circumstances where you want to reuse the listeners you already have registers but want to stop walking the tree at a certain point.
integer = result.value.statements.body.first.receiver.receiver dispatcher.dispatch_once(integer)
Represents the use of an assignment operator on a call.
foo.bar += baz ^^^^^^^^^^^^^^
Represents writing to a class variable in a context that doesn’t have an explicit value.
@@foo, @@bar = baz ^^^^^ ^^^^^
Represents the use of the ‘&&=` operator for assignment to a constant path.
Parent::Child &&= value ^^^^^^^^^^^^^^^^^^^^^^^
Represents accessing a constant through a path of ‘::` operators.
Foo::Bar ^^^^^^^^
Represents the use of the ‘||=` operator for assignment to a constant path.
Parent::Child ||= value ^^^^^^^^^^^^^^^^^^^^^^^
Represents writing to a constant path.
::Foo = 1 ^^^^^^^^^ Foo::Bar = 1 ^^^^^^^^^^^^ ::Foo::Bar = 1 ^^^^^^^^^^^^^^
Represents writing to a constant in a context that doesn’t have an explicit value.
Foo, Bar = baz ^^^ ^^^
Represents a find pattern in pattern matching.
foo in *bar, baz, *qux ^^^^^^^^^^^^^^^ foo in [*bar, baz, *qux] ^^^^^^^^^^^^^^^^^ foo in Foo(*bar, baz, *qux) ^^^^^^^^^^^^^^^^^^^^
Represents forwarding all arguments to this method to another method.
def foo(...) bar(...) ^^^ end
Represents the use of the ‘super` keyword without parentheses or arguments.
super ^^^^^