dmn 0.0.2 → 0.0.4

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.
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module DMN
4
- class UnaryTests < LiteralExpression
5
- attr_reader :id, :text
6
-
7
- def self.from_json(json)
8
- UnaryTests.new(id: json[:id], text: json[:text])
9
- end
10
-
11
- def tree
12
- @tree ||= Parser.parse_test(text)
13
- end
14
-
15
- def valid?
16
- return true if text.nil? || text == '-'
17
- tree.present?
18
- end
19
-
20
- def test(input, variables = {})
21
- return true if text.nil? || text == '-'
22
- tree.eval(functions.merge(variables)).call(input)
23
- end
24
- end
25
- end