Results for: "Data"

Response class for Range Not Satisfiable responses (status code 416).

The request entity has a media type which the server or resource does not support.

References:

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:

No documentation available

The writer adapter class

Raises when the given argument does not match required format.

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)
No documentation available

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 a splat in a hash literal.

{ **foo }
  ^^^^^

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 assigning to a class variable using an operator that isn’t ‘=`.

@@target += value
^^^^^^^^^^^^^^^^^

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.

Target ||= value
^^^^^^^^^^^^^^^^

Represents referencing a constant.

Foo
^^^

Represents writing to a constant.

Foo = 1
^^^^^^^

Represents a find pattern in pattern matching.

foo in *bar, baz, *qux
       ^^^^^^^^^^^^^^^

foo in [*bar, baz, *qux]
       ^^^^^^^^^^^^^^^^^

foo in Foo(*bar, baz, *qux)
       ^^^^^^^^^^^^^^^^^^^^

Represents a floating point number literal.

1.0
^^^

Represents assigning to a global variable using an operator that isn’t ‘=`.

$target += value
^^^^^^^^^^^^^^^^

Represents writing to a global variable in a context that doesn’t have an explicit value.

$foo, $bar = baz
^^^^  ^^^^
Search took: 11ms  ·  Total Results: 1843