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 assigning to an instance variable using an operator that isn’t ‘=`.
@target += value ^^^^^^^^^^^^^^^^
This visitor is responsible for composing the strings that get returned by the various inspect methods defined on each of the nodes.
Represents the use of an assignment operator on a call.
foo.bar += baz ^^^^^^^^^^^^^^
Represents assigning to a constant path using an operator that isn’t ‘=`.
Parent::Child += value ^^^^^^^^^^^^^^^^^^^^^^
Represents the use of an assignment operator on a call to ‘[]`.
foo.bar[baz] += value ^^^^^^^^^^^^^^^^^^^^^
Represents a singleton class declaration involving the ‘class` keyword.
class << self end ^^^^^^^^^^^^^^^^^
This represents a token from the Ruby source.
A class that knows how to walk down the tree. None of the individual visit methods are implemented on this visitor, so it forces the consumer to implement each one that they need. For a default implementation that continues walking the tree, see the Visitor
class.
A visitor is a class that provides a default implementation for every accept method defined on the nodes. This means it can walk a tree without the caller needing to define any special handling. This allows you to handle a subset of the tree, while still walking the whole tree.
For example, to find all of the method calls that call the ‘foo` method, you could write:
class FooCalls < Prism::Visitor def visit_call_node(node) if node.name == "foo" # Do something with the node end # Call super so that the visitor continues walking the tree super end end
Validator
performs various gem file and gem database validation
Scans up/down from the given block
You can try out a change, stash it, or commit it to save for later
Example:
scanner = ScanHistory.new(code_lines: code_lines, block: block) scanner.scan( up: ->(_, _, _) { true }, down: ->(_, _, _) { true } ) scanner.changed? # => true expect(scanner.lines).to eq(code_lines) scanner.stash_changes expect(scanner.lines).to_not eq(code_lines)
RFC6068, the mailto URL scheme.
YAML::Store
provides the same functionality as PStore
, except it uses YAML
to dump objects instead of Marshal
.
require 'yaml/store' Person = Struct.new :first_name, :last_name people = [Person.new("Bob", "Smith"), Person.new("Mary", "Johnson")] store = YAML::Store.new "test.store" store.transaction do store["people"] = people store["greeting"] = { "hello" => "world" } end
After running the above code, the contents of “test.store” will be:
--- people: - !ruby/struct:Person first_name: Bob last_name: Smith - !ruby/struct:Person first_name: Mary last_name: Johnson greeting: hello: world
OCSP
error class.
Raised when an operation would resize or re-allocate a locked buffer.
Raised when the buffer cannot be allocated for some reason, or you try to use a buffer that’s not allocated.