D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Struct
/
Filename :
dig-i.ri
back
Copy
U:RDoc::AnyMethod[iI"dig:ETI"Struct#dig;TF:publico:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"7Finds and returns an object among nested objects. ;TI"=The nested objects may be instances of various classes. ;TI"2See {Dig Methods}[rdoc-ref:dig_methods.rdoc].;To:RDoc::Markup::BlankLine o; ; [I"-Given symbol or string argument +name+, ;TI"Freturns the object that is specified by +name+ and +identifiers+:;T@o:RDoc::Markup::Verbatim; [I"Foo = Struct.new(:a) ;TI"*f = Foo.new(Foo.new({b: [1, 2, 3]})) ;TI"4f.dig(:a) # => #<struct Foo a={:b=>[1, 2, 3]}> ;TI"(f.dig(:a, :a) # => {:b=>[1, 2, 3]} ;TI"&f.dig(:a, :a, :b) # => [1, 2, 3] ;TI"!f.dig(:a, :a, :b, 0) # => 1 ;TI"f.dig(:b, 0) # => nil ;T:@format0o; ; [I"!Given integer argument +n+, ;TI"Creturns the object that is specified by +n+ and +identifiers+:;T@o;; [ I"3f.dig(0) # => #<struct Foo a={:b=>[1, 2, 3]}> ;TI"&f.dig(0, 0) # => {:b=>[1, 2, 3]} ;TI"$f.dig(0, 0, :b) # => [1, 2, 3] ;TI"f.dig(0, 0, :b, 0) # => 1 ;TI"f.dig(:b, 0) # => nil;T; 0: @fileI" struct.c;T:0@omit_headings_from_table_of_contents_below0I"Fdig(name, *identifiers) -> object dig(n, *identifiers) -> object ;T0[ I"(*args);T@)FI"Struct;TcRDoc::NormalClass00