Returns true if the variable is public.
tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') variables = tobj.variables variables.each do |variable| puts "#{variable.name} #{variable.visible?}" end The result of above script is following: xlChart true xlDialogSheet true xlExcel4IntlMacroSheet true xlExcel4MacroSheet true xlWorksheet true
Returns the default value, the value that would be returned by hsh[key] if key did not exist in hsh. See also Hash::new
and Hash#default=
.
h = Hash.new #=> {} h.default #=> nil h.default(2) #=> nil h = Hash.new("cat") #=> {} h.default #=> "cat" h.default(2) #=> "cat" h = Hash.new {|h,k| h[k] = k.to_i*10} #=> {} h.default #=> nil h.default(2) #=> 20
Sets the default value, the value returned for a key that does not exist in the hash. It is not possible to set the default to a Proc
that will be executed on each key lookup.
h = { "a" => 100, "b" => 200 } h.default = "Go fish" h["a"] #=> 100 h["z"] #=> "Go fish" # This doesn't do what you might hope... h.default = proc do |hash, key| hash[key] = key + key end h[2] #=> #<Proc:0x401b3948@-:6> h["cat"] #=> #<Proc:0x401b3948@-:6>
Returns the number of key-value pairs in the hash.
h = { "d" => 100, "a" => 200, "v" => 300, "e" => 400 } h.length #=> 4 h.delete("a") #=> 200 h.length #=> 3
Deletes the key-value pair and returns the value from hsh whose key is equal to key. If the key is not found, it returns nil. If the optional code block is given and the key is not found, pass in the key and return the result of block.
h = { "a" => 100, "b" => 200 } h.delete("a") #=> 100 h.delete("z") #=> nil h.delete("z") { |el| "#{el} not found" } #=> "z not found"
Removes all key-value pairs from hsh.
h = { "a" => 100, "b" => 200 } #=> {"a"=>100, "b"=>200} h.clear #=> {}
Deletes the environment variable with name
and returns the value of the variable. If a block is given it will be called when the named environment does not exist.
Removes every environment variable.
Returns the number of environment variables.
A shortcut for:
CSV.read( path, { headers: true, converters: :numeric, header_converters: :symbol }.merge(options) )
Returns the methods available to this delegate object as the union of this object’s and _getobj_ methods.
Executes the generated ERB
code to produce a completed template, returning the results of that code. (See ERB::new
for details on how this process can be affected by safe_level.)
b accepts a Binding
object which is used to set the context of code evaluation.
Returns true
if fix
is an odd number.
Returns true
if this is a regular (i.e. non-singular) matrix.
Returns true
if this is a singular matrix.
Creates a vector from an Array. The optional second argument specifies whether the array itself or a copy is used internally.
Release code
Removes the last List.
Completes shortened long style option switch and returns pair of canonical switch and switch descriptor OptionParser::Switch
.
typ
Searching table.
opt
Searching key.
icase
Search case insensitive if true.
pat
Optional pattern for completion.
Release code
Removes the last List.
Completes shortened long style option switch and returns pair of canonical switch and switch descriptor OptionParser::Switch
.
typ
Searching table.
opt
Searching key.
icase
Search case insensitive if true.
pat
Optional pattern for completion.