Add bin and edit workflow
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s

This commit is contained in:
2026-09-16 13:11:16 -06:00
parent c8ac4fcae5
commit 4cee170d66
17576 changed files with 895740 additions and 2 deletions
@@ -0,0 +1,21 @@
## Hash#recursively
require 'facets/hash/recursively'
h = {:a=>1, :b=>{:c=>3}}
Without a block passed to the `#recursively` method, the block passed to the
enumeratig method will be used for both recursive and non-recursive yields.
r = h.recursively.map{ |k,v| [k.to_s, v] }
r.assert == [['a', 1], ['b', [['c', 3]]]]
But if we pass a block to `#recursively` we can treat the recusive yield
separately, which in turn allows us to manipulate the non-recursive
yields with a different procedure.
r = h.recursively{ |k,v| [k.to_s, v] }.map{ |k,v| [k.to_s,v.to_s] }
r.assert == [['a','1'], ['b', [['c', '3']]]]