Returns an integer representing the numeric file descriptor for ios.
$stdin.fileno #=> 0 $stdout.fileno #=> 1
Returns the number of key-value pairs in this database.
Removes the key-value-pair with the specified key from this database and returns the corresponding value. Returns nil if the database is empty.
Removes all the key-value pairs within gdbm.
Alias for Regexp.new
Removes all elements and returns self.
set = Set[1, 'c', :s] #=> #<Set: {1, "c", :s}> set.clear #=> #<Set: {}> set #=> #<Set: {}>
Deletes the given object from the set and returns self. Use subtract
to delete many items at once.
Deletes the given object from the set and returns self. If the object is not in the set, returns nil.
Same as sym.to_s.length
.
Returns clean pathname of self
with consecutive slashes and useless dots removed. The filesystem is not accessed.
If consider_symlink
is true
, then a more conservative algorithm is used to avoid breaking symbolic linkages. This may retain more ..
entries than absolutely necessary, but without accessing the filesystem, this can’t be avoided.
See Pathname#realpath
.
Removes a file or directory, using File.unlink
if self
is a file, or Dir.unlink
as necessary.
Tokenizes the Ruby program and returns an array of an array, which is formatted like [[lineno, column], type, token, state]
.
require 'ripper' require 'pp' pp Ripper.lex("def m(a) nil end") #=> [[[1, 0], :on_kw, "def", FNAME ], [[1, 3], :on_sp, " ", FNAME ], [[1, 4], :on_ident, "m", ENDFN ], [[1, 5], :on_lparen, "(", BEG|LABEL], [[1, 6], :on_ident, "a", ARG ], [[1, 7], :on_rparen, ")", ENDFN ], [[1, 8], :on_sp, " ", BEG ], [[1, 9], :on_kw, "nil", END ], [[1, 12], :on_sp, " ", END ], [[1, 13], :on_kw, "end", END ]]
Return current parsing filename.
Returns the number of keys in the database.
Deletes the key-value pair corresponding to the given key
. If the key
exists, the deleted value will be returned, otherwise nil
.
If a block is provided, the deleted key
and value
will be passed to the block as arguments. If the key
does not exist in the database, the value will be nil
.
Deletes all data from the database.
This is a deprecated alias for each_codepoint
.
Returns nil
. Just for compatibility to IO
.
Returns the size of the buffer string.