Results for: "OptionParser"

Foo::Bar ||= baz ^^^^^^^^^^^^^^^^

If the stream begins with a BOM (byte order marker), consumes the BOM and sets the external encoding accordingly; returns the result encoding if found, or nil otherwise:

File.write('t.tmp', "\u{FEFF}abc")
io = File.open('t.tmp', 'rb')
io.set_encoding_by_bom # => #<Encoding:UTF-8>
io.close

File.write('t.tmp', 'abc')
io = File.open('t.tmp', 'rb')
io.set_encoding_by_bom # => nil
io.close

Raises an exception if the stream is not binmode or its encoding has already been set.

Sets the encoding according to the BOM (Byte Order Mark) in the string.

Returns self if the BOM is found, otherwise +nil.

Add a list of paths to the $LOAD_PATH at the proper place.

Open a file with given flags, and protect access with a file lock

Open a file with given flags, and protect access with flock

No documentation available

Returns a URL-encoded string derived from the given string str.

The returned string:

Encoding:

In either case, the returned string has forced encoding Encoding::US_ASCII.

Related: URI.encode_uri_component (encodes ' ' as '%20').

Returns a string decoded from the given URL-encoded string str.

The given string is first encoded as Encoding::ASCII-8BIT (using String#b), then decoded (as below), and finally force-encoded to the given encoding enc.

The returned string:

Related: URI.decode_uri_component (preserves '+').

Returns the string that is used to insert a space before the ‘:’ in JSON objects.

Sets the string that is used to insert a space before the ‘:’ in JSON objects.

This string is put at the end of a line that holds a JSON array.

This string is put at the end of a line that holds a JSON array.

This string is put at the end of a line that holds a JSON array.

This string is put at the end of a line that holds a JSON array.

This integer returns the maximum level of data structure nesting in the generated JSON, max_nesting = 0 if no maximum is checked.

This sets the maximum level of data structure nesting in the generated JSON to the integer depth, max_nesting = 0 if no maximum should be checked.

If this boolean is true, the forward slashes will be escaped in the json output.

If this boolean is true, the forward slashes will be escaped in the json output.

This sets whether or not the forward slashes will be escaped in the json output.

Returns true, if circular data structures should be checked, otherwise returns false.

Returns true, if only ASCII characters should be generated. Otherwise returns false.

This sets whether only ASCII characters should be generated.

Generates a valid JSON document from object obj and returns the result. If no valid JSON document can be created this method raises a GeneratorError exception.

No documentation available
Search took: 6ms  ·  Total Results: 3731