elasticsearch-dsl-builder 0.0.17 → 0.0.18

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
  SHA1:
3
- metadata.gz: 4e9f6de3a22231c91619745c3e9b547bb4719aaa
4
- data.tar.gz: b95ba53e9bc8e28c4ad78b1103be51163bc87216
3
+ metadata.gz: cba0e34f4b2d5f08e57f37dce0099bb9e8252bab
4
+ data.tar.gz: 3b03128a47a64c2d1270ff1c3d2b44fb7704217d
5
5
  SHA512:
6
- metadata.gz: 8ca5470e4df4234de616674ed79f28f07334c777663a8e059e77240d8a88169b8c6fbd6af848aadc77b0a4a24fe89e87c6c193d23b3c2dce3da4bc718e8dbda2
7
- data.tar.gz: c05e3cc6dd26eb397ea0750c87109b93367901633e2883f473d68134bee7b092c1d20c6d70f03b2d172ee9d97299148512cdd7d690f890a67fe6225a3d5ea2ef
6
+ metadata.gz: 7a318bff127840356b34951fc156fe0c642c5dea9da4aca5140422e858f6c4dd43bfbdb449d45a0171b536cc923b42168a6260f214c8685379d2ff5c4571956d
7
+ data.tar.gz: ebf0db9e17d50adb1615ed4157831073ace8866eadc75aaf8d215ec7884759d89a0d3739869017892068a0caf8cc18950321950fcfb77a6976d5cc69c8ce95d1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- elasticsearch-dsl-builder (0.0.17)
4
+ elasticsearch-dsl-builder (0.0.18)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'elasticsearch-dsl-builder'
3
- s.version = '0.0.17'
3
+ s.version = '0.0.18'
4
4
  s.date = '2017-10-06'
5
5
  s.summary = 'Library utilizing builder pattern providing Ruby API for the Elasticsearch Query DSL'
6
6
  s.description = 'TBD'
@@ -21,6 +21,7 @@ module ElasticsearchDslBuilder
21
21
  end
22
22
 
23
23
  def to_hash
24
+ raise ArgumentError, 'must have set at least one of [field, script]' if @field.nil? && @script.nil?
24
25
  @aggregation = {}
25
26
  @aggregation.update(field: @field) if @field
26
27
  @aggregation.update(script: @script) if @script
@@ -43,7 +43,9 @@ module ElasticsearchDslBuilder
43
43
  end
44
44
 
45
45
  def to_hash
46
- @aggregation = { field: @field }
46
+ raise ArgumentError, 'must have set at least one of [field, script]' if @field.nil? && @script.nil?
47
+ @aggregation = {}
48
+ @aggregation.update(field: @field) if @field
47
49
  @aggregation.update(script: @script) if @script
48
50
  @aggregation.update(size: @size) if @size
49
51
  @aggregation.update(include: @include) if @include
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-dsl-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marvin Guerra