Results for: "to_proc"

Returns the bits in stat as an Integer. Poking around in these bits is platform dependent.

fork { exit 0xab }         #=> 26566
Process.wait               #=> 26566
sprintf('%04x', $?.to_i)   #=> "ab00"

Show pid and exit status as a string.

system("false")
p $?.to_s         #=> "pid 12766 exit 1"

This exception is raised if a generator or unparser error occurs.

Response class for Payload Too Large responses (status code 413).

The request is larger than the server is willing or able to process. See 413 Payload Too Large.

Response class for URI Too Long responses (status code 414).

The URI provided was too long for the server to process. See 414 URI Too Long.

Response class for URI Too Long responses (status code 414).

The URI provided was too long for the server to process. See 414 URI Too Long.

Response class for Request Header Fields Too Large responses (status code 431).

An individual header field is too large, or all the header fields collectively, are too large. See 431 Request Header Fields Too Large.

Cleans up after a partially-failed uninstall or for an invalid Gem::Specification.

If a specification was removed by hand this will remove any remaining files.

If a corrupt specification was installed this will clean up warnings by removing the bogus specification.

DO NOT USE THIS DIRECTLY.

Hook method to return whether the obj can respond to id method or not.

When the method name parameter is given as a string, the string is converted to a symbol.

See respond_to?, and the example of BasicObject.

Returns IPv4 address of IPv4 mapped/compatible IPv6 address. It returns nil if self is not IPv4 mapped/compatible IPv6 address.

Addrinfo.ip("::192.0.2.3").ipv6_to_ipv4      #=> #<Addrinfo: 192.0.2.3>
Addrinfo.ip("::ffff:192.0.2.3").ipv6_to_ipv4 #=> #<Addrinfo: 192.0.2.3>
Addrinfo.ip("::1").ipv6_to_ipv4              #=> nil
Addrinfo.ip("192.0.2.3").ipv6_to_ipv4        #=> nil
Addrinfo.unix("/tmp/sock").ipv6_to_ipv4      #=> nil

Returns IO instance tied to ARGF for writing if inplace mode is enabled.

Checks for a method provided by this the delegate object by forwarding the call through _getobj_.

Expands lazy enumerator to an array. See Enumerable#to_a.

Returns the memory address for this closure.

The integer memory location of this function

Returns the memory address for this handle.

No documentation available

Returns the integer memory location of this pointer.

ptr.to_s        => string
ptr.to_s(len)   => string

Returns the pointer contents as a string.

When called with no arguments, this method will return the contents until the first NULL byte.

When called with len, a string of len bytes will be returned.

See to_str

Returns the string representation of the bignum.

BN.new can parse the encoded string to convert back into an OpenSSL::BN.

base

The format. Must be one of the following:

  • 0 - MPI format. See the man page BN_bn2mpi(3) for details.

  • 2 - Variable-length and big-endian binary encoding. The sign of the bignum is ignored.

  • 10 - Decimal number representation, with a leading ‘-’ for a negative bignum.

  • 16 - Hexadeciaml number representation, with a leading ‘-’ for a negative bignum.

No documentation available

Returns the authentication code as a hex-encoded string. The digest parameter specifies the digest algorithm to use. This may be a String representing the algorithm name or an instance of OpenSSL::Digest.

Example

key = 'key'
data = 'The quick brown fox jumps over the lazy dog'

hmac = OpenSSL::HMAC.hexdigest('SHA1', key, data)
#=> "de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9"

Gets the parsable form of the current configuration.

Given the following configuration being created:

config = OpenSSL::Config.new
  #=> #<OpenSSL::Config sections=[]>
config['default'] = {"foo"=>"bar","baz"=>"buz"}
  #=> {"foo"=>"bar", "baz"=>"buz"}
puts config.to_s
  #=> [ default ]
  #   foo=bar
  #   baz=buz

You can parse get the serialized configuration using to_s and then parse it later:

serialized_config = config.to_s
# much later...
new_config = OpenSSL::Config.parse(serialized_config)
  #=> #<OpenSSL::Config sections=["default"]>
puts new_config
  #=> [ default ]
      foo=bar
      baz=buz
No documentation available

returns the socket option data as a string.

p Socket::Option.new(:INET6, :IPV6, :RECVPKTINFO, [1].pack("i!")).data
#=> "\x01\x00\x00\x00"
Search took: 3ms  ·  Total Results: 1731