D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
ObjectSpace
/
WeakKeyMap
/
Filename :
delete-i.ri
back
Copy
U:RDoc::AnyMethod[iI"delete:ETI"#ObjectSpace::WeakKeyMap#delete;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"LDeletes the entry for the given +key+ and returns its associated value.;To:RDoc::Markup::BlankLine o; ; [I"aIf no block is given and +key+ is found, deletes the entry and returns the associated value:;To:RDoc::Markup::Verbatim; [ I"%m = ObjectSpace::WeakKeyMap.new ;TI"0key = "foo" # to hold reference to the key ;TI"m[key] = 1 ;TI"m.delete("foo") # => 1 ;TI"m["foo"] # => nil ;T:@format0o; ; [I"=If no block given and +key+ is not found, returns +nil+.;T@o; ; [I"@If a block is given and +key+ is found, ignores the block, ;TI"9deletes the entry, and returns the associated value:;To;; [ I"%m = ObjectSpace::WeakKeyMap.new ;TI"0key = "foo" # to hold reference to the key ;TI"m[key] = 2 ;TI"?m.delete("foo") { |key| raise 'Will never happen'} # => 2 ;T; 0o; ; [I"1If a block is given and +key+ is not found, ;TI"Hyields the +key+ to the block and returns the block's return value:;To;; [I"%m = ObjectSpace::WeakKeyMap.new ;TI"Tm.delete("nosuch") { |key| "Key #{key} not found" } # => "Key nosuch not found";T; 0: @fileI"weakmap.c;T:0@omit_headings_from_table_of_contents_below0I"Lmap.delete(key) -> value or nil map.delete(key) {|key| ... } -> object ;T0[ I" (p1);T@.FI"WeakKeyMap;TcRDoc::NormalClass00