dhall 0.3.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/dhall/visitor.rb DELETED
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Dhall
4
- class Visitor
5
- def initialize(callbacks)
6
- @callbacks = callbacks
7
- end
8
-
9
- def visit(expr)
10
- expr.to_h.each_with_object({}) do |(attr, value), h|
11
- if (callback = callback_for(value))
12
- h[attr] = callback.call(value)
13
- end
14
- end
15
- end
16
-
17
- protected
18
-
19
- def callback_for(x)
20
- @callbacks.find { |k, _| k === x }&.last
21
- end
22
- end
23
- end