- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- Location:
- EcnlProtoTool/trunk/mruby-1.3.0
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/mruby-1.3.0/mrbgems/mruby-struct/mrblib/struct.rb
r321 r331 83 83 alias to_s inspect 84 84 end 85 86 ## 87 # call-seq: 88 # hsh.dig(key,...) -> object 89 # 90 # Extracts the nested value specified by the sequence of <i>key</i> 91 # objects by calling +dig+ at each step, returning +nil+ if any 92 # intermediate step is +nil+. 93 # 94 def dig(idx,*args) 95 n = self[idx] 96 if args.size > 0 97 n&.dig(*args) 98 else 99 n 100 end 101 end 85 102 end 86 103
Note:
See TracChangeset
for help on using the changeset viewer.