Deserializes JSON
string by constructing new Regexp
object with source s
(Regexp
or String) and options o
serialized by to_json
Returns true if this class can be used to create an instance from a serialised JSON
string. The class has to implement a class method json_create that expects a hash as first parameter. The hash should include the required data.
Iterates over each component of the path.
Pathname.new("/usr/bin/ruby").each_filename {|filename| ... } # yields "usr", "bin", and "ruby".
Returns an Enumerator
if no block was given.
enum = Pathname.new("/usr/bin/ruby").each_filename # ... do stuff ... enum.each { |e| ... } # yields "usr", "bin", and "ruby".
Return the path as a String.
to_path
is implemented so Pathname
objects are usable with File.open
, etc.
Iterates over each line in the file and yields a String object for each.
Iterates over the entries (files and subdirectories) in the directory, yielding a Pathname
object for each entry.
Returns an Array of values corresponding to the given keys.
Iterates over each value
in the database.
If no block is given, returns an Enumerator
.
Iterates over each key-value pair in the database.
If no block is given, returns an Enumerator
.
Returns true for IPv4 private address (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16). It returns false otherwise.
Returns true for IPv4-mapped IPv6 address (::ffff:0:0/80). It returns false otherwise.
Returns true for IPv4-compatible IPv6 address (::/80). It returns false otherwise.
Returns the socket path as a string.
Addrinfo.unix("/tmp/sock").unix_path #=> "/tmp/sock"
This returns the value that scan_until
would return, without advancing the scan pointer. The match register is affected, though.
s = StringScanner.new("Fri Dec 12 1975 14:39") s.check_until /12/ # -> "Fri Dec 12" s.pos # -> 0 s.matched # -> 12
Mnemonic: it “checks” to see whether a scan_until
will return a value.
Scans the string until the pattern
is matched. Advances the scan pointer if advance_pointer_p
, otherwise not. Returns the matched string if return_string_p
is true, otherwise returns the number of bytes advanced. This method does affect the match register.
Creates GUID.
WIN32OLE.create_guid # => {1CB530F1-F6B1-404D-BCE6-1959BF91F4A8}
Returns major version.
tobj = WIN32OLE_TYPE.new('Microsoft Word 10.0 Object Library', 'Documents') puts tobj.major_version # => 8