Results for: "partition"

No documentation available

Returns the full file path of this frame.

Same as path, except that it will return absolute path even if the frame is in the main script.

No documentation available

Iterates the given block for each element with an index, which starts from offset. If no block is given, returns a new Enumerator that includes the index, starting from offset

offset

the starting index to use

Returns a new lazy enumerator with the concatenated results of running block once for every element in the lazy enumerator.

["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]

A value x returned by block is decomposed if either of the following conditions is true:

Otherwise, x is contained as-is in the return value.

[{a:1}, {b:2}].lazy.flat_map {|i| i}.force
#=> [{:a=>1}, {:b=>2}]

Load an iseq object from binary format String object created by RubyVM::InstructionSequence.to_binary.

This loader does not have a verifier, so that loading broken/modified binary causes critical problem.

You should not load binary data provided by others. You should use binary data translated by yourself.

No documentation available

Returns integer 80, the default port to use for HTTP requests:

Net::HTTP.http_default_port # => 80

Returns integer 443, the default port to use for HTTPS requests:

Net::HTTP.https_default_port # => 443

Sets the encoding to be used for the response body; returns the encoding.

The given value may be:

See Encoding.

Examples:

http = Net::HTTP.new(hostname)
http.response_body_encoding = Encoding::US_ASCII # => #<Encoding:US-ASCII>
http.response_body_encoding = 'US-ASCII'         # => "US-ASCII"
http.response_body_encoding = 'ASCII'            # => "ASCII"

Returns integer 80, the default port to use for HTTP requests:

Net::HTTP.http_default_port # => 80

Returns integer 443, the default port to use for HTTPS requests:

Net::HTTP.https_default_port # => 443

Sets the encoding to be used for the response body; returns the encoding.

The given value may be:

See Encoding.

Examples:

http = Net::HTTP.new(hostname)
http.response_body_encoding = Encoding::US_ASCII # => #<Encoding:US-ASCII>
http.response_body_encoding = 'US-ASCII'         # => "US-ASCII"
http.response_body_encoding = 'ASCII'            # => "ASCII"

Returns whether the request may have a body:

Net::HTTP::Post.new(uri).request_body_permitted? # => true
Net::HTTP::Get.new(uri).request_body_permitted?  # => false
No documentation available

Define --enable / --disable style option

Appears as --enable-name in help message.

Define --enable / --disable style option

Appears as --disable-name in help message.

Returns the offset from the start of the file for the given byte offset counting in code units for the given encoding.

This method is tested with UTF-8, UTF-16, and UTF-32. If there is the concept of code units that differs from the number of characters in other encodings, it is not captured here.

We purposefully replace invalid and undefined characters with replacement characters in this conversion. This happens for two reasons. First, it’s possible that the given byte offset will not occur on a character boundary. Second, it’s possible that the source code will contain a character that has no equivalent in the given encoding.

Generate a cache that targets a specific encoding for calculating code unit offsets.

Returns the column number in code units for the given encoding for the given byte offset.

Returns the offset from the start of the file for the given byte offset counting in code units for the given encoding.

This method is tested with UTF-8, UTF-16, and UTF-32. If there is the concept of code units that differs from the number of characters in other encodings, it is not captured here.

Returns a cache that is the identity function in order to maintain the same interface. We can do this because code units are always equivalent to byte offsets for ASCII-only sources.

Specialized version of ‘code_units_column` that does not depend on `code_units_offset`, which is a more expensive operation. This is essentially the same as `Prism::Source#column`.

The character offset from the beginning of the source where this location ends.

The column number in characters where this location ends from the start of the line.

Search took: 4ms  ·  Total Results: 2857