pragmatic_ql 0.3 → 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.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/pragmatic_ql/include_model.rb +22 -0
- data/lib/pragmatic_ql/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9345924c9ae9c102ddd123ccbffae9cbd86dbeec75a9e6bbbb7b49f16ce8028b
|
4
|
+
data.tar.gz: 76767192f2d2c0e2a46e534bee12aaba99f064fe0366dc1599a4ef9f7588aba6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 351cb3fd023787cd8621c98e6ea4ad7b78560f5534a059d709bc20c30a72e720e83971a8e11f5ab75a8a08e2567a0bfc8e38daee6a2ff0302bac576fd5e18337
|
7
|
+
data.tar.gz: 1f1a90a241d14bdbe7edf3d5068ec0a64425b221a9d947cfa199a5f63538cf14c4bde67f6caf369eb0af038c996dfa62f96e86fac5e609e3b88ad8dfc3157f1a
|
data/Gemfile.lock
CHANGED
@@ -38,6 +38,16 @@ module PragmaticQL
|
|
38
38
|
"<#IncludeModel #{@include_hash.inspect}>"
|
39
39
|
end
|
40
40
|
|
41
|
+
def to_h
|
42
|
+
@include_hash
|
43
|
+
end
|
44
|
+
|
45
|
+
def to_s
|
46
|
+
ary = []
|
47
|
+
build_include_string(@include_hash, nil, ary)
|
48
|
+
ary.join(',')
|
49
|
+
end
|
50
|
+
|
41
51
|
def or(other)
|
42
52
|
hooks.each { |hook| hook.or(other) }
|
43
53
|
self.empty? ? other : self
|
@@ -46,5 +56,17 @@ module PragmaticQL
|
|
46
56
|
def level_keys
|
47
57
|
@include_hash.keys
|
48
58
|
end
|
59
|
+
|
60
|
+
private
|
61
|
+
def build_include_string(node, key, ary)
|
62
|
+
node.each do |k, v|
|
63
|
+
new_key = [key, k.to_s].compact.join('.')
|
64
|
+
if v.any?
|
65
|
+
build_include_string(v, new_key, ary)
|
66
|
+
else
|
67
|
+
ary << new_key
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
49
71
|
end
|
50
72
|
end
|
data/lib/pragmatic_ql/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pragmatic_ql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Valent
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: exe
|
15
15
|
cert_chain: []
|
16
|
-
date: 2022-01-
|
16
|
+
date: 2022-01-17 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: activesupport
|