connectors_utility 8.6.0.4.pre.20221115T001812Z → 8.6.0.4.pre.20221115T002329Z

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac5e3edace211b9ddceef02ec8785a9967ddbce0c346f629f40bce93bb1e4951
4
- data.tar.gz: e766607f3784e051d52beedb5acec6a8e1fdbfc8334245980c21ac2e06777c10
3
+ metadata.gz: 996cc59bf15e82bf245bc30716d0ac93861514fe9f8e73f92948f80e60adccc4
4
+ data.tar.gz: f904929c8d82a73e1763cf30536c7e703b885d633f05e9cdecbba310eb44d99d
5
5
  SHA512:
6
- metadata.gz: f8cb0768b2bd020d16b54bde70b396f88316fa68092663d0cf05045140b932e94e4aeb3646700527bc07517fff04e7296efccf77d22df8aad6ddbb7b7eaaa7b1
7
- data.tar.gz: ae307da6fdec1df3733d910ee7df68aad9fb52f15710539dabde845a405359534c63793649da5445c0191b2c51252ca3616e1f515177038dc317302e95cfcd64
6
+ metadata.gz: d22401f2411e468c734bb015e6027ede2858a64fcdeb6ea446ad9cc4871c68791e736dea230e5a2fcee2c77b84514c41314cd866f7766bb2906e4396b1c557e8
7
+ data.tar.gz: e3ed8f7cb8e0d10bfbc220520ff7d98dcc7d221ee65f4790976eb6e1f538f78ac781eaa453258896749ed56e41eb3cf3c065a206cbb209740d43dbe6b37f7b52
@@ -0,0 +1,22 @@
1
+ #
2
+ # Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ # or more contributor license agreements. Licensed under the Elastic License;
4
+ # you may not use this file except in compliance with the Elastic License.
5
+ #
6
+
7
+ # frozen_string_literal: true
8
+
9
+ module Utility
10
+ class Filtering
11
+ class << self
12
+ def extract_filter(filtering)
13
+ return {} unless filtering.present?
14
+
15
+ # assume for now, that first object in filtering array or a filter object itself is the only filtering object
16
+ filter = filtering.is_a?(Array) ? filtering.first : filtering
17
+
18
+ filter.present? ? filter : {}
19
+ end
20
+ end
21
+ end
22
+ end
data/lib/utility.rb CHANGED
@@ -12,6 +12,7 @@ require 'utility/elasticsearch/index/mappings'
12
12
  require 'utility/elasticsearch/index/text_analysis_settings'
13
13
  require 'utility/environment'
14
14
  require 'utility/errors'
15
+ require 'utility/filtering'
15
16
  require 'utility/es_client'
16
17
  require 'utility/exception_tracking'
17
18
  require 'utility/extension_mapping_util'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: connectors_utility
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.6.0.4.pre.20221115T001812Z
4
+ version: 8.6.0.4.pre.20221115T002329Z
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
@@ -123,6 +123,7 @@ files:
123
123
  - lib/utility/es_client.rb
124
124
  - lib/utility/exception_tracking.rb
125
125
  - lib/utility/extension_mapping_util.rb
126
+ - lib/utility/filtering.rb
126
127
  - lib/utility/logger.rb
127
128
  homepage: https://github.com/elastic/connectors-ruby
128
129
  licenses: