Class: Lucene::UnaryOp

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/knife-solo/resources/patch_cookbooks/chef-solo-search/libraries/search/parser.rb,
lib/knife-solo/resources/patch_cookbooks/chef-solo-search/libraries/vendor/chef/solr_query/lucene_nodes.rb

Instance Method Summary collapse

Instance Method Details

#match(item) ⇒ Object



162
163
164
165
166
# File 'lib/knife-solo/resources/patch_cookbooks/chef-solo-search/libraries/search/parser.rb', line 162

def match( item )
  self.elements[0].match(
    self.elements[1].match(item)
  )
end

#to_arrayObject



224
225
226
227
228
# File 'lib/knife-solo/resources/patch_cookbooks/chef-solo-search/libraries/vendor/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/knife-solo/resources/patch_cookbooks/chef-solo-search/libraries/vendor/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