Stores the specified string value in the database, indexed via the string key provided.
Associates the value value with the specified key.
Stores a new value
in the database with the given key
as an index.
If the key
already exists, this will update the value
associated with the key
.
Returns the given value
.
Associates the value given by value
with the key given by key
.
h = { "a" => 100, "b" => 200 } h["a"] = 9 h["c"] = 4 h #=> {"a"=>9, "b"=>200, "c"=>4} h.store("d", 42) #=> 42 h #=> {"a"=>9, "b"=>200, "c"=>4, "d"=>42}
key
should not have its value changed while it is in use as a key (an unfrozen String
passed as a key will be duplicated and frozen).
a = "a" b = "b".freeze h = { a => 100, b => 200 } h.key(100).equal? a #=> false h.key(200).equal? b #=> true
Sets the environment variable name
to value
. If the value given is nil
the environment variable is deleted. name
must be a string.
Returns true
if the named file is a directory, or a symlink that points at a directory, and false
otherwise.
file_name can be an IO
object.
File.directory?(".")
Returns a list of modules included/prepended in mod (including mod itself).
module Mod include Math include Comparable prepend Enumerable end Mod.ancestors #=> [Enumerable, Mod, Comparable, Math] Math.ancestors #=> [Math] Enumerable.ancestors #=> [Enumerable]
Returns true
if the named file is a directory, or a symlink that points at a directory, and false
otherwise.
file_name can be an IO
object.
File.directory?(".")
Sends a STORE command to alter data associated with messages in the mailbox, in particular their flags. The set
parameter is a number, an array of numbers, or a Range
object. Each number is a message sequence number. attr
is the name of a data item to store: ‘FLAGS’ will replace the message’s flag list with the provided one, ‘+FLAGS’ will add the provided flags, and ‘-FLAGS’ will remove them. flags
is a list of flags.
The return value is an array of Net::IMAP::FetchData
. For example:
p imap.store(6..8, "+FLAGS", [:Deleted]) #=> [#<Net::IMAP::FetchData seqno=6, attr={"FLAGS"=>[:Seen, :Deleted]}>, \\ #<Net::IMAP::FetchData seqno=7, attr={"FLAGS"=>[:Seen, :Deleted]}>, \\ #<Net::IMAP::FetchData seqno=8, attr={"FLAGS"=>[:Seen, :Deleted]}>]
Stores value
in database with key
as the index. value
is converted to YAML before being stored.
Returns value
Quietly ensure the Gem directory dir
contains all the proper subdirectories. If we can’t create a directory due to a permission problem, then we will silently continue.
If mode
is given, missing directories are created with this mode.
World-writable directories will never be created.
Ruby tries to load the library named string relative to the requiring file’s path. If the file’s path cannot be determined a LoadError
is raised. If a file is loaded true
is returned and false otherwise.
Returns true if the contents of a stream a
and b
are identical.
Returns true if the contents of a stream a
and b
are identical.
Similar to store()
, but set
contains unique identifiers.
No longer raises NoMemoryError
when allocating an instance of the given classes.
Quietly ensure the Gem directory dir
contains all the proper subdirectories for handling default gems. If we can’t create a directory due to a permission problem, then we will silently continue.
If mode
is given, missing directories are created with this mode.
World-writable directories will never be created.
Returns true
if the named file is a directory, or a symlink that points at a directory, and false
otherwise.
file_name can be an IO
object.
File.directory?(".")
Puts the connection into binary (image) mode, issues the given server-side command (such as “STOR myfile”), and sends the contents of the file named file
to the server. If the optional block is given, it also passes it the data, in chunks of blocksize
characters.
Puts the connection into ASCII (text) mode, issues the given server-side command (such as “STOR myfile”), and sends the contents of the file named file
to the server, one line at a time. If the optional block is given, it also passes it the lines.