elasticsearch_query 0.1.4 → 0.1.5

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
- SHA1:
3
- metadata.gz: 3b7dae4d8223abee9fa7445967d0de3a98a1e5ac
4
- data.tar.gz: 54c3721c81a46637c4245378b634a9fa363cb035
2
+ SHA256:
3
+ metadata.gz: 5718f45baed1683548365a1f965e002dc1ff465aad73e89388c8e9ee8963cb32
4
+ data.tar.gz: 8d125c04dbf463147ec71eae1ac8889f5b47e904dd5398d5da375b7dca3d4378
5
5
  SHA512:
6
- metadata.gz: 51ab090dc88ee074e8d455fdd26fcf3f8907cd04cfbff58089ad75cabb5a3249421531eb37d972a957c511354bb26e182c90fcb82d06335e98a4b2c3bb63bcf6
7
- data.tar.gz: 71ef71664c92803818a503d15f5f70e0201759de36366bd61ae5bed8b3e0b80fdc2ea7c0b2f0fa8ef4d681443284f437c4fb6b6046a5abed2385d6f29ebf52aa
6
+ metadata.gz: 219c411e8973fd1fc4c88bfa907f9a60dbe24c97fd673975f6a2f1cd78ac0e890574b8e66d852115715e22d85ef1854c47258a6bec9352e034f85bb4dc43e33a
7
+ data.tar.gz: 97fedcd5411c7a59c13136aa8515207755dda0e23e045a8a349c7a6e17b23a269917e233683d462c9e0c4798242b016921424941080f6d69620be9d965e7a5e3
@@ -1,12 +1,18 @@
1
1
  module ElasticsearchQuery
2
2
  module FilterFormatter
3
3
  autoload :Base, 'elasticsearch_query/filter_formatter/base'
4
+ autoload :Custom,'elasticsearch_query/filter_formatter/custom'
4
5
  autoload :Match, 'elasticsearch_query/filter_formatter/match'
5
6
  autoload :Range, 'elasticsearch_query/filter_formatter/range'
6
7
 
7
8
  class << self
8
9
  def formatter_for( value )
9
- !!value.match( /\.\./ ) ? FilterFormatter::Range : FilterFormatter::Match
10
+ case value
11
+ when String
12
+ !!value.match( /\.\./ ) ? FilterFormatter::Range : FilterFormatter::Match
13
+ when Hash
14
+ FilterFormatter::Custom
15
+ end
10
16
  end
11
17
  end
12
18
  end
@@ -0,0 +1,9 @@
1
+ module ElasticsearchQuery
2
+ module FilterFormatter
3
+ class Custom < Base
4
+ def to_hash
5
+ @value
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module ElasticsearchQuery
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch_query
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Orlov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-20 00:00:00.000000000 Z
11
+ date: 2021-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -89,6 +89,7 @@ files:
89
89
  - lib/elasticsearch_query/filter.rb
90
90
  - lib/elasticsearch_query/filter_formatter.rb
91
91
  - lib/elasticsearch_query/filter_formatter/base.rb
92
+ - lib/elasticsearch_query/filter_formatter/custom.rb
92
93
  - lib/elasticsearch_query/filter_formatter/match.rb
93
94
  - lib/elasticsearch_query/filter_formatter/range.rb
94
95
  - lib/elasticsearch_query/filters.rb
@@ -114,8 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
115
  - !ruby/object:Gem::Version
115
116
  version: '0'
116
117
  requirements: []
117
- rubyforge_project:
118
- rubygems_version: 2.6.14
118
+ rubygems_version: 3.0.3
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: Elasticsearch Query from Rails params