Linux server1.dn-server.com 4.18.0-553.89.1.lve.el8.x86_64 #1 SMP Wed Dec 10 13:58:50 UTC 2025 x86_64
LiteSpeed
Server IP : 195.201.204.189 & Your IP : 216.73.216.198
Domains :
Cant Read [ /etc/named.conf ]
User : beriska1
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
alt /
ruby30 /
share /
doc /
alt-ruby30-doc /
Delete
Unzip
Name
Size
Permission
Date
Action
images
[ DIR ]
drwxr-xr-x
2026-05-01 04:23
irb
[ DIR ]
drwxr-xr-x
2026-05-01 04:23
pty
[ DIR ]
drwxr-xr-x
2026-05-01 04:23
syntax
[ DIR ]
drwxr-xr-x
2026-05-01 04:23
ChangeLog
2.13
MB
-rw-r--r--
2024-04-23 13:53
ChangeLog-0.06_to_0.52
46.51
KB
-rw-r--r--
2024-04-23 13:53
ChangeLog-0.50_to_0.60
18.81
KB
-rw-r--r--
2024-04-23 13:53
ChangeLog-0.60_to_1.1
129.14
KB
-rw-r--r--
2024-04-23 13:53
ChangeLog-1.8.0
728.09
KB
-rw-r--r--
2024-04-23 13:53
ChangeLog-1.9.3
2.86
MB
-rw-r--r--
2024-04-23 13:53
ChangeLog-2.0.0
830.16
KB
-rw-r--r--
2024-04-23 13:53
ChangeLog-2.1.0
603.56
KB
-rw-r--r--
2024-04-23 13:53
ChangeLog-2.2.0
401.16
KB
-rw-r--r--
2024-04-23 13:53
ChangeLog-2.3.0
400.76
KB
-rw-r--r--
2024-04-23 13:53
ChangeLog-2.4.0
327.98
KB
-rw-r--r--
2024-04-23 13:53
ChangeLog-YARV
144.66
KB
-rw-r--r--
2024-04-23 13:53
NEWS-1.8.7
14.22
KB
-rw-r--r--
2024-04-23 13:53
NEWS-1.9.1
15.54
KB
-rw-r--r--
2024-04-23 13:53
NEWS-1.9.2
12.07
KB
-rw-r--r--
2024-04-23 13:53
NEWS-1.9.3
9.76
KB
-rw-r--r--
2024-04-23 13:53
NEWS-2.0.0
18.01
KB
-rw-r--r--
2024-04-23 13:53
NEWS-2.1.0
11.97
KB
-rw-r--r--
2024-04-23 13:53
NEWS-2.2.0
11.47
KB
-rw-r--r--
2024-04-23 13:53
NEWS-2.3.0
12.63
KB
-rw-r--r--
2024-04-23 13:53
NEWS-2.4.0
11.31
KB
-rw-r--r--
2024-04-23 13:53
NEWS-2.5.0
16.7
KB
-rw-r--r--
2024-04-23 13:53
NEWS-2.6.0
17.87
KB
-rw-r--r--
2024-04-23 13:53
NEWS-2.7.0
24.21
KB
-rw-r--r--
2024-04-23 13:53
README.md
6.6
KB
-rw-r--r--
2024-04-23 13:53
bug_triaging.rdoc
4.04
KB
-rw-r--r--
2024-04-23 13:53
contributing.rdoc
16.34
KB
-rw-r--r--
2024-04-23 13:53
dig_methods.rdoc
2.57
KB
-rw-r--r--
2024-04-23 13:53
dtrace_probes.rdoc
7.42
KB
-rw-r--r--
2024-04-23 13:53
extension.ja.rdoc
71.98
KB
-rw-r--r--
2024-04-23 13:53
extension.rdoc
70.49
KB
-rw-r--r--
2024-04-23 13:53
fiber.md
4.94
KB
-rw-r--r--
2024-04-23 13:53
forwardable.rd.ja
2.34
KB
-rw-r--r--
2024-04-23 13:53
globals.rdoc
4.33
KB
-rw-r--r--
2024-04-23 13:53
implicit_conversion.rdoc
5.5
KB
-rw-r--r--
2024-04-23 13:53
keywords.rdoc
4.63
KB
-rw-r--r--
2024-04-23 13:53
maintainers.rdoc
10.96
KB
-rw-r--r--
2024-04-23 13:53
make_cheatsheet.md
2.54
KB
-rw-r--r--
2024-04-23 13:53
marshal.rdoc
11.51
KB
-rw-r--r--
2024-04-23 13:53
memory_view.md
6.51
KB
-rw-r--r--
2024-04-23 13:53
method_documentation.rdoc
7.17
KB
-rw-r--r--
2024-04-23 13:53
ractor.md
25.94
KB
-rw-r--r--
2024-04-23 13:53
regexp.rdoc
28.82
KB
-rw-r--r--
2024-04-23 13:53
ruby-exercise.stp
1.08
KB
-rw-r--r--
2024-06-26 17:17
security.rdoc
5.72
KB
-rw-r--r--
2024-04-23 13:53
signals.rdoc
3.33
KB
-rw-r--r--
2024-04-23 13:53
standard_library.rdoc
5.96
KB
-rw-r--r--
2024-04-23 13:53
syntax.rdoc
1.21
KB
-rw-r--r--
2024-04-23 13:53
yarvarch.en
106
B
-rw-r--r--
2024-04-23 13:53
yarvarch.ja
16.41
KB
-rw-r--r--
2024-04-23 13:53
Save
Rename
= Dig Methods Ruby's +dig+ methods are useful for accessing nested data structures. Consider this data: item = { id: "0001", type: "donut", name: "Cake", ppu: 0.55, batters: { batter: [ {id: "1001", type: "Regular"}, {id: "1002", type: "Chocolate"}, {id: "1003", type: "Blueberry"}, {id: "1004", type: "Devil's Food"} ] }, topping: [ {id: "5001", type: "None"}, {id: "5002", type: "Glazed"}, {id: "5005", type: "Sugar"}, {id: "5007", type: "Powdered Sugar"}, {id: "5006", type: "Chocolate with Sprinkles"}, {id: "5003", type: "Chocolate"}, {id: "5004", type: "Maple"} ] } Without a +dig+ method, you can write: item[:batters][:batter][1][:type] # => "Chocolate" With a +dig+ method, you can write: item.dig(:batters, :batter, 1, :type) # => "Chocolate" Without a +dig+ method, you can write, erroneously (raises <tt>NoMethodError (undefined method `[]' for nil:NilClass)</tt>): item[:batters][:BATTER][1][:type] With a +dig+ method, you can write (still erroneously, but avoiding the exception): item.dig(:batters, :BATTER, 1, :type) # => nil == Why Is +dig+ Better? - It has fewer syntactical elements (to get wrong). - It reads better. - It does not raise an exception if an item is not found. == How Does +dig+ Work? The call sequence is: obj.dig(*identifiers) The +identifiers+ define a "path" into the nested data structures: - For each identifier in +identifiers+, calls method \#dig on a receiver with that identifier. - The first receiver is +self+. - Each successive receiver is the value returned by the previous call to +dig+. - The value finally returned is the value returned by the last call to +dig+. A +dig+ method raises an exception if any receiver does not respond to \#dig: h = { foo: 1 } # Raises TypeError (Integer does not have #dig method): h.dig(:foo, :bar) == What Else? The structure above has \Hash objects and \Array objects, both of which have instance method +dig+. Altogether there are six built-in Ruby classes that have method +dig+, three in the core classes and three in the standard library. In the core: - Array#dig: the first argument is an \Integer index. - Hash#dig: the first argument is a key. - Struct#dig: the first argument is a key. In the standard library: - OpenStruct#dig: the first argument is a \String name. - CSV::Table#dig: the first argument is an \Integer index or a \String header. - CSV::Row#dig: the first argument is an \Integer index or a \String header.