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
.
Sets the value to WIN32OLE
object specified by a1, a2, …
dict = WIN32OLE.new('Scripting.Dictionary') dict.add('ruby', 'RUBY') dict['ruby'] = 'Ruby' puts dict['ruby'] # => 'Ruby'
Remark: You can not use this method to set the property value.
excel = WIN32OLE.new('Excel.Application') # excel['Visible'] = true # This is error !!! excel.Visible = true # You should to use this style to set the property.
Set
the element of WIN32OLE_VARIANT
object(OLE array) to val. This method is available only when the variant type of WIN32OLE_VARIANT
object is VT_ARRAY.
REMARK:
The all indices should be 0 or natural number and lower than or equal to max indices. (This point is different with Ruby Array indices.) obj = WIN32OLE_VARIANT.new([[1,2,3],[4,5,6]]) obj[0,0] = 7 obj[1,0] = 8 p obj.value # => [[7,2,3], [8,5,6]] obj[2,0] = 9 # => WIN32OLERuntimeError obj[0, -1] = 9 # => WIN32OLERuntimeError
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.
Set
element or elements of matrix.
Set
element or elements of vector.
Stores an individual Ruby object or a hierarchy of Ruby objects in the data store file under the root name. Assigning to a name already in the data store clobbers the old data.
require "pstore" store = PStore.new("data_file.pstore") store.transaction do # begin transaction # load some data into the store... store[:single_object] = "My data..." store[:obj_hierarchy] = { "Kev Jackson" => ["rational.rb", "pstore.rb"], "James Gray" => ["erb.rb", "pstore.rb"] } end # commit changes to data store file
WARNING: This method is only valid in a PStore#transaction
and it cannot be read-only. It will raise PStore::Error
if called at any other time.
Attribute Assignment—Sets or creates the value of a fiber-local variable, using either a symbol or a string.
See also Thread#[]
.
For thread-local variables, please see thread_variable_set
and thread_variable_get
.
Changes the string being scanned to str
and resets the scanner. Returns str
.
Returns help string of OLE method. If the help string is not found, then the method returns nil.
tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'IWebBrowser') method = WIN32OLE_METHOD.new(tobj, 'Navigate') puts method.helpstring # => Navigates to a URL or file.
Returns help string.
tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'IWebBrowser') puts tobj.helpstring # => Web Browser interface
Adds a post-installs hook that will be passed a Gem::DependencyInstaller
and a list of installed specifications when Gem::DependencyInstaller#install
is complete
Set
struct member name
, to value val
Set
the value at index
to int
.
Or, set the memory at start
until length
with the contents of string
, the memory from dl_cptr
, or the memory pointed at by the memory address addr
.
Sets a specific section name with a Hash
pairs.
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
It’s important to note that this will essentially merge any of the keys in pairs with the existing section. For example:
config['default'] #=> {"foo"=>"bar", "baz"=>"buz"} config['default'] = {"foo" => "changed"} #=> {"foo"=>"changed"} config['default'] #=> {"foo"=>"changed", "baz"=>"buz"}
Creates a weak reference from the given key to the given value
Set
the session data for key key
.
Looks up the field by the semantics described in CSV::Row.field()
and assigns the value
.
Assigning past the end of the row with an index will set all pairs between to [nil, nil]
. Assigning to an unused header appends the new pair.
In the default mixed mode, this method assigns rows for index access and columns for header access. You can force the index association by first calling by_col
!() or by_row
!().
Rows may be set to an Array
of values (which will inherit the table’s headers()) or a CSV::Row
.
Columns may be set to a single value, which is copied to each row of the column, or an Array
of values. Arrays of values are assigned to rows top to bottom in row major order. Excess values are ignored and if the Array
does not have a value for each row the extra rows will receive a nil
.
Assigning to an existing column or row clobbers the data. Assigning to new columns creates them at the right end of the table.
Stores value v
at key
in the GW