D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Hash
/
Filename :
fetch_values-i.ri
back
Copy
U:RDoc::AnyMethod[iI"fetch_values:ETI"Hash#fetch_values;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"TReturns a new Array containing the values associated with the given keys *keys:;To:RDoc::Markup::Verbatim; [I""h = {foo: 0, bar: 1, baz: 2} ;TI",h.fetch_values(:baz, :foo) # => [2, 0] ;T:@format0o; ; [I"5Returns a new empty Array if no arguments given.;To:RDoc::Markup::BlankLine o; ; [I"CWhen a block is given, calls the block with each missing key, ;TI"Atreating the block's return value as the value for that key:;To;; [I""h = {foo: 0, bar: 1, baz: 2} ;TI"Fvalues = h.fetch_values(:bar, :foo, :bad, :bam) {|key| key.to_s} ;TI"&values # => [1, 0, "bad", "bam"] ;T;0o; ; [I"OWhen no block is given, raises an exception if any given key is not found.;T: @fileI"hash.c;T:0@omit_headings_from_table_of_contents_below0I"^hash.fetch_values(*keys) -> new_array hash.fetch_values(*keys) {|key| ... } -> new_array ;T0[ I"(*args);T@"FI" Hash;TcRDoc::NormalClass00