Mixin for holding meta-information.
Flags for arguments nodes.
Flags for interpolated string nodes that indicated mutability if they are also marked as literals.
Flags for keyword hash nodes.
A parser for the pack template language.
This module is responsible for converting the prism syntax tree into other syntax trees.
Formats generated random numbers in many manners. When 'random/formatter'
is required, several methods are added to empty core module Random::Formatter
, making them available as Random’s instance and module methods.
Standard library SecureRandom
is also extended with the module, and the methods described below are available as a module methods in it.
Generate random hexadecimal strings:
require 'random/formatter' prng = Random.new prng.hex(10) #=> "52750b30ffbc7de3b362" prng.hex(10) #=> "92b15d6c8dc4beb5f559" prng.hex(13) #=> "39b290146bea6ce975c37cfc23" # or just Random.hex #=> "1aed0c631e41be7f77365415541052ee"
Generate random base64 strings:
prng.base64(10) #=> "EcmTPZwWRAozdA==" prng.base64(10) #=> "KO1nIU+p9DKxGg==" prng.base64(12) #=> "7kJSM/MzBJI+75j8" Random.base64(4) #=> "bsQ3fQ=="
Generate random binary strings:
prng.random_bytes(10) #=> "\016\t{\370g\310pbr\301" prng.random_bytes(10) #=> "\323U\030TO\234\357\020\a\337" Random.random_bytes(6) #=> "\xA1\xE6Lr\xC43"
Generate alphanumeric strings:
prng.alphanumeric(10) #=> "S8baxMJnPl" prng.alphanumeric(10) #=> "aOxAg8BAJe" Random.alphanumeric #=> "TmP9OsJHJLtaZYhP"
Generate UUIDs:
prng.uuid #=> "2d931510-d99f-494a-8c67-87feb05e1594" prng.uuid #=> "bad85eb9-0713-4da7-8d36-07a8e4b00eab" Random.uuid #=> "f14e0271-de96-45cc-8911-8910292a42cd"
All methods are available in the standard library SecureRandom
, too:
SecureRandom.hex #=> "05b45376a30c67238eb93b16499e50cf"
Generate a random number in the given range as Random
does
prng.random_number #=> 0.5816771641321361 prng.random_number(1000) #=> 485 prng.random_number(1..6) #=> 3 prng.rand #=> 0.5816771641321361 prng.rand(1000) #=> 485 prng.rand(1..6) #=> 3
Mixin methods for install and update options for Gem::Commands
This module is used for safely loading YAML
specs from a gem. The ‘safe_load` method defined on this module is specifically designed for loading Gem specifications. For loading other YAML
safely, please see Psych.safe_load
Mixin methods for Gem::Command
to promote available RubyGems update
A stub yaml serializer that can handle only hashes and strings (as of now).
Generic exception class of the Timestamp
module.
TimeStamp
struct
Handles “Negotiate” type authentication. Geared towards authenticating with a proxy server over HTTP
Class for representing HTTP method PATCH:
require 'net/http' uri = URI('http://example.com') hostname = uri.hostname # => "example.com" uri.path = '/posts' req = Net::HTTP::Patch.new(uri) # => #<Net::HTTP::Patch PATCH> req.body = '{"title": "foo","body": "bar","userId": 1}' req.content_type = 'application/json' res = Net::HTTP.start(hostname) do |http| http.request(req) end
See Request Headers.
Properties:
Request body: yes.
Response body: yes.
Safe: no.
Idempotent: no.
Cacheable: no.
Related:
Net::HTTP#patch
: sends PATCH
request, returns response object.
Class for representing WebDAV method PROPPATCH:
require 'net/http' uri = URI('http://example.com') hostname = uri.hostname # => "example.com" req = Net::HTTP::Proppatch.new(uri) # => #<Net::HTTP::Proppatch PROPPATCH> res = Net::HTTP.start(hostname) do |http| http.request(req) end
See Request Headers.
Related:
Net::HTTP#proppatch
: sends PROPPATCH
request, returns response object.
Switch
that can omit argument.
If we have an identifier that follows a method name like:
def foo bar
then Ripper
will mark bar as END|LABEL if there is a local in a parent scope named bar because it hasn’t pushed the local table yet. We do this more accurately, so we need to allow comparing against both END and END|LABEL.
An optional location field represents the location of some part of the node in the source code that may or may not be present. It resolves to either a Prism::Location
or nil in Ruby.
SvcParams
for service binding RRs. [RFC9460]
Base class for SvcParam
. [RFC9460]