Results for: "OptionParser"

No documentation available

Stores form data to be used in a POST or PUT request.

The form data given in params consists of zero or more fields; each field is:

Argument params should be an Enumerable (method params.map will be called), and is often an array or hash.

First, we set up a request:

_uri = uri.dup
_uri.path ='/posts'
req = Net::HTTP::Post.new(_uri)

Argument params As an Array

When params is an array, each of its elements is a subarray that defines a field; the subarray may contain:

The various forms may be mixed:

req.set_form(['foo', %w[bar 1], ['file', file]])

Argument params As a Hash

When params is a hash, each of its entries is a name/value pair that defines a field:

Examples:

# Nil-valued fields.
req.set_form({'foo' => nil, 'bar' => nil, 'baz' => nil})

# String-valued fields.
req.set_form({'foo' => 0, 'bar' => 1, 'baz' => 2})

# IO-valued field.
require 'stringio'
req.set_form({'file' => StringIO.new('Ruby is cool.')})

# Mixture of fields.
req.set_form({'foo' => nil, 'bar' => 1, 'file' => file})

Optional argument enctype specifies the value to be given to field 'Content-Type', and must be one of:

Optional argument formopt is a hash of options (applicable only when argument enctype is 'multipart/form-data') that may include the following entries:

returns “type/subtype” which is MIME Content-Type. It is downcased for canonicalization. Content-Type parameters are stripped.

Returns a list of encodings in Content-Encoding field as an array of strings.

The encodings are downcased for canonicalization.

No documentation available

Generate a random URL-safe base64 string.

The argument n specifies the length, in bytes, of the random number to be generated. The length of the result string is about 4/3 of n.

If n is not specified or is nil, 16 is assumed. It may be larger in the future.

The boolean argument padding specifies the padding. If it is false or nil, padding is not generated. Otherwise padding is generated. By default, padding is not generated because “=” may be used as a URL delimiter.

The result may contain A-Z, a-z, 0-9, “-” and “_”. “=” is also used if padding is true.

require 'random/formatter'

Random.urlsafe_base64 #=> "b4GOKm4pOYU_-BOXcrUGDg"
# or
prng = Random.new
prng.urlsafe_base64 #=> "UZLdOkzop70Ddx-IJR0ABg"

prng.urlsafe_base64(nil, true) #=> "i0XQ-7gglIsHGV2_BNPrdQ=="
prng.urlsafe_base64(nil, true) #=> "-M8rLhr7JEpJlqFGUMmOxg=="

See RFC 3548 for the definition of URL-safe base64.

Generates formatted random number from raw random bytes. See Random#rand.

No documentation available

Creates an unsigned certificate for subject and key. The lifetime of the key is from the current time to age which defaults to one year.

The extensions restrict the key to the indicated uses.

No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available

Use new_ui for the duration of block.

See DefaultUserInteraction::use_ui

No documentation available
No documentation available

Discard statistics collected for --yjit-stats.

Return a hash for statistics generated for the --yjit-stats command line option. Return nil when option is not passed or unavailable. If a symbol argument is provided, return only the value for the named stat. If any other type is provided, raises TypeError.

Foo, = bar ^^^

Foo::Bar ^^^^^^^^

foo => [, bar, ] ^^^^^^^^^^^

def foo(…); bar(…); end ^^^

Search took: 6ms  ·  Total Results: 3694