pragmatic_ql 0.2 → 0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db43534747874c7bc19d631804a18968be7fce6b5b3cacbc29e27f7e4378d4a0
4
- data.tar.gz: 21000233f0760251b44b859403e7ab0fe57826bf94062fb46081adac04886f90
3
+ metadata.gz: 715af39de3a12f58db1c9ff9d79a70b39cc852d7afaea345ea30ec992f86160e
4
+ data.tar.gz: fb7b868bbbe996baaccb89776a5223ee3e47f21dfe0bd7d83c4ee36c3fc1f5ac
5
5
  SHA512:
6
- metadata.gz: 37ac077510f771f4a1e993dd153d4426459260218fb138cd017a7c0d9755313fbbfa015146e1afd5ec6cf0d56d7e1aa3f0e18581ed1e07153b7e174c7b063068
7
- data.tar.gz: 8c92696e114c518b725c2f75e06baeb7dc94d0b7d7cec34c7c799c451f9f584b748eebeb15a4eeba5e0517616aff9b8695147274fbfb120819100cc530921f67
6
+ metadata.gz: 72c1f6b0e6e9b568c276178aa3e675ee96167d4a7d135223b2df17ac25b0cb28ab2647b4715eb7c61d6dd4779ac66eae86c98947e318603b18c5f061a05cb889
7
+ data.tar.gz: 06b266317e9d5b6dfe1aaa996483c8402a40596d4a693ee3dee111964b84d6cda204fddd1bfaee704162d44eff2d385905d019f53ee599b48a9b485760bd0b70
@@ -1,15 +1,24 @@
1
1
  module PragmaticQL
2
2
  class IncludeModel
3
+ attr_reader :hooks
4
+
3
5
  def initialize(include_hash)
4
6
  @include_hash = include_hash
7
+ @hooks = []
5
8
  end
6
9
 
7
10
  def for(node_name)
11
+ hooks.each { |hook| hook.for(node_name) }
12
+
8
13
  node_hash = @include_hash.fetch(node_name.to_sym) { {} }
9
- IncludeModel.new(node_hash)
14
+ new_im = IncludeModel.new(node_hash)
15
+ hooks.each { |hook| new_im.hooks << hook }
16
+ new_im
10
17
  end
11
18
 
12
19
  def inclusive_of?(key_name)
20
+ hooks.each { |hook| hook.inclusive_of?(key_name) }
21
+
13
22
  level_keys.include?(key_name.to_sym)
14
23
  end
15
24
 
@@ -30,6 +39,7 @@ module PragmaticQL
30
39
  end
31
40
 
32
41
  def or(other)
42
+ hooks.each { |hook| hook.or(other) }
33
43
  self.empty? ? other : self
34
44
  end
35
45
 
@@ -31,6 +31,7 @@ module PragmaticQL
31
31
  def include_hash
32
32
  return {} if include_string.blank?
33
33
  include_list = include_string
34
+ .gsub(/\s/, '')
34
35
  .split(',')
35
36
  .map { |con| con.split('.') }
36
37
 
@@ -1,3 +1,3 @@
1
1
  module PragmaticQL
2
- VERSION = "0.2"
2
+ VERSION = "0.3"
3
3
  end
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.2'
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Valent
@@ -10,10 +10,10 @@ authors:
10
10
  - Anas Alaoui
11
11
  - Alexander Sidorenko
12
12
  - Matthijs Hovelynck
13
- autorequire:
13
+ autorequire:
14
14
  bindir: exe
15
15
  cert_chain: []
16
- date: 2021-05-25 00:00:00.000000000 Z
16
+ date: 2022-01-14 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: activesupport
@@ -104,7 +104,7 @@ homepage: https://github.com/Pobble/pragmatic_ql
104
104
  licenses:
105
105
  - MIT
106
106
  metadata: {}
107
- post_install_message:
107
+ post_install_message:
108
108
  rdoc_options: []
109
109
  require_paths:
110
110
  - lib
@@ -119,8 +119,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  requirements: []
122
- rubygems_version: 3.2.17
123
- signing_key:
122
+ rubygems_version: 3.2.32
123
+ signing_key:
124
124
  specification_version: 4
125
125
  summary: Simple query language for JSON based APIs
126
126
  test_files: []