The name of the unresolved dependency
Extract the host part of the URI
and unwrap brackets for IPv6 addresses.
This method is the same as URI::Generic#host
except brackets for IPv6 (and future IP) addresses are removed.
uri = URI("http://[::1]/bar") uri.hostname #=> "::1" uri.host #=> "[::1]"
Sets the host part of the URI
as the argument with brackets for IPv6 addresses.
This method is the same as URI::Generic#host=
except the argument can be a bare IPv6 address.
uri = URI("http://foo/bar") uri.hostname = "::1" uri.to_s #=> "http://[::1]/bar"
If the argument seems to be an IPv6 address, it is wrapped with brackets.
v
Public setter for the path component v
(with validation).
See also URI::Generic.check_path
.
require 'uri' uri = URI.parse("http://my.example.com/pub/files") uri.path = "/faq/" uri.to_s #=> "http://my.example.com/faq/"
Returns the conversion path of ec.
The result is an array of conversions.
ec = Encoding::Converter.new("ISO-8859-1", "EUC-JP", crlf_newline: true) p ec.convpath #=> [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>], # [#<Encoding:UTF-8>, #<Encoding:EUC-JP>], # "crlf_newline"]
Each element of the array is a pair of encodings or a string. A pair means an encoding conversion. A string means a decorator.
In the above example, [#<Encoding:ISO-8859-1>,
Create a new BlockParameterNode
node
Create a new BlockParametersNode
node
Create a new ConstantPathAndWriteNode
node
Create a new ConstantPathOrWriteNode
node
Create a new ConstantPathTargetNode
node
Create a new ConstantPathWriteNode
node
Create a new ForwardingParameterNode
node
Create a new ItParametersNode
node
Create a new KeywordRestParameterNode
node
Create a new NoKeywordsParameterNode
node
Create a new NumberedParametersNode
node
Create a new ParametersNode
node
Create a new RequiredKeywordParameterNode
node
Create a new RequiredParameterNode
node
Create a new RestParameterNode
node
Calls the block, if given, with combinations of elements of self
; returns self
. The order of combinations is indeterminate.
When a block and an in-range positive Integer
argument n
(0 < n <= self.size
) are given, calls the block with all n
-tuple combinations of self
.
Example:
a = [0, 1, 2] a.combination(2) {|combination| p combination }
Output:
[0, 1] [0, 2] [1, 2]
Another example:
a = [0, 1, 2] a.combination(3) {|combination| p combination }
Output:
[0, 1, 2]
When n
is zero, calls the block once with a new empty Array
:
a = [0, 1, 2] a1 = a.combination(0) {|combination| p combination }
Output:
[]
When n
is out of range (negative or larger than self.size
), does not call the block:
a = [0, 1, 2] a.combination(-1) {|combination| fail 'Cannot happen' } a.combination(4) {|combination| fail 'Cannot happen' }
Returns a new Enumerator
if no block given:
a = [0, 1, 2] a.combination(2) # => #<Enumerator: [0, 1, 2]:combination(2)>
Returns self
.
Returns 1
.
Returns the value as a rational. The optional argument eps
is always ignored.