D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
ObjectSpace
/
WeakMap
/
Filename :
delete-i.ri
back
Copy
U:RDoc::AnyMethod[iI"delete:ETI" ObjectSpace::WeakMap#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::WeakMap.new ;TI"key = "foo" ;TI"m[key] = 1 ;TI"m.delete(key) # => 1 ;TI"m[key] # => nil ;T:@format0o; ; [I"@If no block is 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::WeakMap.new ;TI"key = "foo" ;TI"m[key] = 2 ;TI"=m.delete(key) { |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::WeakMap.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"WeakMap;TcRDoc::NormalClass00