D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Struct
/
Filename :
values_at-i.ri
back
Copy
U:RDoc::AnyMethod[iI"values_at:ETI"Struct#values_at;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I",Returns an array of values from +self+.;To:RDoc::Markup::BlankLine o; ; [I".With integer arguments +integers+ given, ;TI"Greturns an array containing each value given by one of +integers+:;T@o:RDoc::Markup::Verbatim; [I"2Customer = Struct.new(:name, :address, :zip) ;TI"Ejoe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345) ;TI"6joe.values_at(0, 2) # => ["Joe Smith", 12345] ;TI"6joe.values_at(2, 0) # => [12345, "Joe Smith"] ;TI"Ojoe.values_at(2, 1, 0) # => [12345, "123 Maple, Anytown NC", "Joe Smith"] ;TI"<joe.values_at(0, -3) # => ["Joe Smith", "Joe Smith"] ;T:@format0o; ; [I"=Raises IndexError if any of +integers+ is out of range; ;TI"see Array@Array+Indexes.;T@o; ; [I"8With integer range argument +integer_range+ given, ;TI"Preturns an array containing each value given by the elements of the range; ;TI"Jfills with +nil+ values for range elements larger than the structure:;T@o;; [ I"joe.values_at(0..2) ;TI"8# => ["Joe Smith", "123 Maple, Anytown NC", 12345] ;TI"joe.values_at(-3..-1) ;TI"8# => ["Joe Smith", "123 Maple, Anytown NC", 12345] ;TI"Ijoe.values_at(1..4) # => ["123 Maple, Anytown NC", 12345, nil, nil] ;T; 0o; ; [I"QRaises RangeError if any element of the range is negative and out of range; ;TI"see Array@Array+Indexes.;T: @fileI" struct.c;T:0@omit_headings_from_table_of_contents_below0I"Evalues_at(*integers) -> array values_at(integer_range) -> array ;T0[ I"(*args);T@/FI"Struct;TcRDoc::NormalClass00