Response class for Bad Gateway
responses (status code 502).
The server was acting as a gateway or proxy and received an invalid response from the upstream server.
References:
Response class for Gateway Timeout
responses (status code 504).
The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
References:
Response class for Gateway Timeout
responses (status code 504).
The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
References:
Response class for Network Authentication Required
responses (status code 511).
The client needs to authenticate to gain network access.
References:
The writer adapter class
Raises when the given argument does not match required format.
Represents assigning to a class variable using an operator that isn’t ‘=`.
@@target += value ^^^^^^^^^^^^^^^^^
Represents the use of the ‘||=` operator for assignment to a constant.
Target ||= value ^^^^^^^^^^^^^^^^
Represents assigning to a global variable using an operator that isn’t ‘=`.
$target += value ^^^^^^^^^^^^^^^^
Represents the use of the ‘&&=` operator for assignment to an instance variable.
@target &&= value ^^^^^^^^^^^^^^^^^
Represents the use of the ‘||=` operator for assignment to an instance variable.
@target ||= value ^^^^^^^^^^^^^^^^^
Represents assigning to a local variable using an operator that isn’t ‘=`.
target += value ^^^^^^^^^^^^^^^
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 dispatcher = 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 an array pattern in pattern matching.
foo in 1, 2 ^^^^^^^^^^^ foo in [1, 2] ^^^^^^^^^^^^^ foo in *1 ^^^^^^^^^ foo in Bar[] ^^^^^^^^^^^^ foo in Bar[1, 2, 3] ^^^^^^^^^^^^^^^^^^^
Represents the use of an assignment operator on a call.
foo.bar += baz ^^^^^^^^^^^^^^
Represents assigning to a method call.
foo.bar, = 1 ^^^^^^^ begin rescue => foo.bar ^^^^^^^ end for foo.bar in baz do end ^^^^^^^
Represents assigning to a local variable in pattern matching.
foo => [bar => baz] ^^^^^^^^^^^^
Represents the use of a case statement for pattern matching.
case true in false end ^^^^^^^^^
Represents writing to a class variable 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) ^^^^^^^^^^^^^^^^^^^^