Class: Chewy::Query::Nodes::Prefix
- Defined in:
- lib/chewy/query/nodes/prefix.rb
Instance Method Summary collapse
- #__render__ ⇒ Object
-
#initialize(name, value, options = {}) ⇒ Prefix
constructor
A new instance of Prefix.
Methods inherited from Expr
Methods inherited from Base
Constructor Details
#initialize(name, value, options = {}) ⇒ Prefix
Returns a new instance of Prefix.
5 6 7 8 |
# File 'lib/chewy/query/nodes/prefix.rb', line 5 def initialize name, value, = {} @name = name.to_s @value, @options = value, end |
Instance Method Details
#__render__ ⇒ Object
10 11 12 13 14 |
# File 'lib/chewy/query/nodes/prefix.rb', line 10 def __render__ filter = {prefix: {@name => @value}} filter[:prefix][:_cache] = !!@options[:cache] if @options.key?(:cache) filter end |