Immutable and read-only representation of a timestamp token info from a Response
.
Class for representing WebDAV method UNLOCK:
require 'net/http' uri = URI('http://example.com') hostname = uri.hostname # => "example.com" req = Net::HTTP::Unlock.new(uri) # => #<Net::HTTP::Unlock UNLOCK> res = Net::HTTP.start(hostname) do |http| http.request(req) end
See Request Headers.
Related:
Net::HTTP#unlock
: sends UNLOCK
request, returns response object.
A FetchError
that indicates that the reason for not being able to fetch data was that the host could not be contacted
Error raised when no cdylib artifact was created
IO
wrapper that allows writing a limited amount of data
Removes duplicate elements from self
, the first occurrence always being retained; returns self
if any elements removed, nil
otherwise.
With no block given, identifies and removes elements using method eql?
to compare elements:
a = [0, 0, 1, 1, 2, 2] a.uniq! # => [0, 1, 2] a.uniq! # => nil
With a block given, calls the block for each element; identifies and omits “duplicate” elements using method eql?
to compare block return values; that is, an element is a duplicate if its block return value is the same as that of a previous element:
a = ['a', 'aa', 'aaa', 'b', 'bb', 'bbb'] a.uniq! {|element| element.size } # => ["a", "aa", "aaa"] a.uniq! {|element| element.size } # => nil
Related: see Methods for Deleting.
Returns true for IPv6 unique local address (fc00::/7, RFC4193). It returns false otherwise.
Returns a new array that is the union of the elements of self
and all given arrays other_arrays
; items are compared using eql?
:
[0, 1, 2, 3].union([4, 5], [6, 7]) # => [0, 1, 2, 3, 4, 5, 6, 7]
Removes duplicates (preserving the first found):
[0, 1, 1].union([2, 1], [3, 1]) # => [0, 1, 2, 3]
Preserves order (preserving the position of the first found):
[3, 2, 1, 0].union([5, 3], [4, 2]) # => [3, 2, 1, 0, 5, 4]
With no arguments given, returns a copy of self
.
Related: see Methods for Combining.
Returns a new regexp that is the union of the given patterns:
r = Regexp.union(%w[cat dog]) # => /cat|dog/ r.match('cat') # => #<MatchData "cat"> r.match('dog') # => #<MatchData "dog"> r.match('cog') # => nil
For each pattern that is a string, Regexp.new(pattern)
is used:
Regexp.union('penzance') # => /penzance/ Regexp.union('a+b*c') # => /a\+b\*c/ Regexp.union('skiing', 'sledding') # => /skiing|sledding/ Regexp.union(['skiing', 'sledding']) # => /skiing|sledding/
For each pattern that is a regexp, it is used as is, including its flags:
Regexp.union(/foo/i, /bar/m, /baz/x) # => /(?i-mx:foo)|(?m-ix:bar)|(?x-mi:baz)/ Regexp.union([/foo/i, /bar/m, /baz/x]) # => /(?i-mx:foo)|(?m-ix:bar)|(?x-mi:baz)/
With no arguments, returns /(?!)/
:
Regexp.union # => /(?!)/
If any regexp pattern contains captures, the behavior is unspecified.
creates a new socket connected to path using UNIX socket socket.
If a block is given, the block is called with the socket. The value of the block is returned. The socket is closed when this method returns.
If no block is given, the socket is returned.
# talk to /tmp/sock socket. Socket.unix("/tmp/sock") {|sock| t = Thread.new { IO.copy_stream(sock, STDOUT) } IO.copy_stream(STDIN, sock) t.join }