Class: Lucene::UnaryOp

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/chef/solr_query/lucene_nodes.rb

Instance Method Summary collapse

Instance Method Details

#to_arrayObject


224
225
226
227
228
# File 'lib/chef/solr_query/lucene_nodes.rb', line 224

def to_array
  op = self.elements[0].to_array
  a = self.elements[1].to_array
  "(#{op} #{a})"
end

#transformObject


230
231
232
233
234
235
236
237
238
239
240
# File 'lib/chef/solr_query/lucene_nodes.rb', line 230

def transform
  op = self.elements[0].transform
  a = self.elements[1].transform
  spc = case op
        when "+", "-"
          ""
        else
          " "
        end
  "#{op}#{spc}#{a}"
end