Class: Hotdog::Commands::Search::RegexpTagValueNode

Inherits:
RegexpExpressionNode show all
Defined in:
lib/hotdog/commands/search.rb

Instance Attribute Summary

Attributes inherited from TagExpressionNode

#attribute, #identifier, #separator

Instance Method Summary collapse

Methods inherited from RegexpExpressionNode

#dump

Methods inherited from TagExpressionNode

#==, #attribute?, #dump, #evaluate, #identifier?, #maybe_fallback, #maybe_glob, #maybe_query, #maybe_query_without_condition, #optimize, #reload, #separator?, #to_glob

Methods inherited from ExpressionNode

#dump, #evaluate, #intermediates, #leafs, #optimize

Constructor Details

#initialize(attribute, separator = nil) ⇒ RegexpTagValueNode

Returns a new instance of RegexpTagValueNode.



1330
1331
1332
# File 'lib/hotdog/commands/search.rb', line 1330

def initialize(attribute, separator=nil)
  super(nil, attribute, separator)
end

Instance Method Details

#condition(options = {}) ⇒ Object



1334
1335
1336
# File 'lib/hotdog/commands/search.rb', line 1334

def condition(options={})
  "hosts.name REGEXP ? OR tags.value REGEXP ?"
end

#condition_tables(options = {}) ⇒ Object



1338
1339
1340
# File 'lib/hotdog/commands/search.rb', line 1338

def condition_tables(options={})
  [:hosts, :tags]
end

#condition_values(options = {}) ⇒ Object



1342
1343
1344
# File 'lib/hotdog/commands/search.rb', line 1342

def condition_values(options={})
  [attribute, attribute]
end