vPublic setter for the scheme component v (with validation).
See also URI::Generic.check_scheme.
require 'uri' uri = URI.parse("http://my.example.com") uri.scheme = "https" uri.to_s #=> "https://my.example.com"
vPublic 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 true if URI is hierarchical.
URI has components listed in order of decreasing significance from left to right, see RFC3986 tools.ietf.org/html/rfc3986 1.2.3.
require 'uri' uri = URI.parse("http://my.example.com/") uri.hierarchical? #=> true uri = URI.parse("mailto:joe@example.com") uri.hierarchical? #=> false
Returns true if URI does not have a scheme (e.g. http:// or https://) specified.
Returns normalized URI.
require 'uri' URI("HTTP://my.EXAMPLE.com").normalize #=> #<URI::HTTP http://my.example.com/>
Normalization here means:
scheme and host are converted to lowercase,
an empty path component is set to “/”.
Destructive version of normalize.
Returns attributes.
Setter for attributes val.
Iterates over the request headers
Sets the response’s status to the status code
Iterates over each header in the response
Will this response body be returned using chunked transfer-encoding?
Enables chunked transfer encoding.
Unmounts dir
Shortcut for logging a FATAL message
Will the logger output FATAL messages?
Updates the database with multiple values from the specified object. Takes any object which implements the each_pair method, including Hash and DBM objects.
Returns self.
Returns the least significant eight bits of the return code of stat. Only available if exited? is true.
fork { } #=> 26572 Process.wait #=> 26572 $?.exited? #=> true $?.exitstatus #=> 0 fork { exit 99 } #=> 26573 Process.wait #=> 26573 $?.exited? #=> true $?.exitstatus #=> 99
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>,
Updates the digest using a given string and returns self.
The update() method and the left-shift operator are overridden by each implementation subclass. (One should be an alias for the other)
Construct a new class given a C:
class klass (CUnion, CStruct, or other that provide an entity_class)
types (Fiddle::TYPE_INT, Fiddle::TYPE_SIZE_T, etc., see the C types constants)
corresponding members
Fiddle::Importer#struct and Fiddle::Importer#union wrap this functionality in an easy-to-use manner.
Example:
require 'fiddle/struct' require 'fiddle/cparser' include Fiddle::CParser types, members = parse_struct_signature(['int i','char c']) MyStruct = Fiddle::CStructBuilder.create(Fiddle::CUnion, types, members) obj = MyStruct.allocate
Construct a new class given a C:
class klass (CUnion, CStruct, or other that provide an entity_class)
types (Fiddle::TYPE_INT, Fiddle::TYPE_SIZE_T, etc., see the C types constants)
corresponding members
Fiddle::Importer#struct and Fiddle::Importer#union wrap this functionality in an easy-to-use manner.
Example:
require 'fiddle/struct' require 'fiddle/cparser' include Fiddle::CParser types, members = parse_struct_signature(['int i','char c']) MyStruct = Fiddle::CStructBuilder.create(Fiddle::CUnion, types, members) obj = MyStruct.allocate