arelastic 1.0.2 → 1.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
  SHA1:
3
- metadata.gz: 641cd6053b327302f8529f932cdc9ebbdd1cf2db
4
- data.tar.gz: 5efe134f612087964773827a385cd666a0772d81
3
+ metadata.gz: 9423c0576c44867372fc88a1ca44407425d06e15
4
+ data.tar.gz: aa0065aea8b9ba21ff8cdf1a757f1117a1a53f23
5
5
  SHA512:
6
- metadata.gz: beb4a0a08070175f28a8a0c3ac643862286a04db60bdc745525283af0966caa77331b5c74fd7e8f054c5569f754f45f846d737c3ee3ff5d16f07ecacf8118fd9
7
- data.tar.gz: 0814f98db8b56257e05f607f64f551b3e311a6f02248f2f8e246e3004cb1bb52440b0ea992aa47a01dee280527a9e411167be9159197398ec591be2289105cfd
6
+ metadata.gz: b5818ba5af9d8e1df98f26288ad4a36e5872f2ce1dc057224bd18643df27832935ec69fe8702aaa90077dc5a99b88d6fce8693b8345b58fa652faa997538ab71
7
+ data.tar.gz: 5d0fd2581a854c34602319803c50b3a13f87b66d9e7ef524f8acb5676d75f5370cd37d18ddc3070c8db6db831b353e71112ef76f4e0ffaa7ce9b31fe7c4246fb
@@ -1,16 +1,15 @@
1
1
  module Arelastic
2
2
  module Filters
3
3
  class GeoBoundingBox < Arelastic::Filters::Filter
4
- attr_accessor :field, :top_left, :bottom_right, :options
5
- def initialize(field, top_left, bottom_right, options = {})
6
- @field = field
7
- @top_left = top_left
8
- @bottom_right = bottom_right
9
- @options = options
4
+ attr_accessor :field, :bounds, :options
5
+ def initialize(field, bounds, options = {})
6
+ @field = field
7
+ @bounds = bounds
8
+ @options = options
10
9
  end
11
10
 
12
11
  def as_elastic
13
- params = {field => {"top_left" => top_left, "bottom_right" => bottom_right}}.update(options)
12
+ params = {field => bounds}.update(options)
14
13
 
15
14
  { "geo_bounding_box" => params }
16
15
  end
@@ -13,7 +13,7 @@ class Arelastic::Filters::GeoBoundingBoxTest < Minitest::Test
13
13
 
14
14
  assert_equal(
15
15
  expected,
16
- Arelastic::Filters::GeoBoundingBox.new('location', [40, -70], [30, -60]).as_elastic
16
+ Arelastic::Filters::GeoBoundingBox.new('location', 'top_left' => [40, -70], 'bottom_right' => [30, -60]).as_elastic
17
17
  )
18
18
  end
19
19
 
@@ -30,7 +30,7 @@ class Arelastic::Filters::GeoBoundingBoxTest < Minitest::Test
30
30
 
31
31
  assert_equal(
32
32
  expected,
33
- Arelastic::Filters::GeoBoundingBox.new('location', [40, -70], [30, -60], 'index' => true).as_elastic
33
+ Arelastic::Filters::GeoBoundingBox.new('location', {'top_left' => [40, -70], 'bottom_right' => [30, -60]}, 'index' => true).as_elastic
34
34
  )
35
35
  end
36
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arelastic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Higgins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-11 00:00:00.000000000 Z
11
+ date: 2016-01-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Build Elastic Search queries with objects
14
14
  email: developer@matthewhiggins.com