Class: Hotdog::Expression::RegexpHostOrTagNode

Inherits:
RegexpExpressionNode show all
Defined in:
lib/hotdog/expression/semantics.rb

Instance Attribute Summary

Attributes inherited from TagExpressionNode

#separator, #tagname, #tagvalue

Instance Method Summary collapse

Methods inherited from RegexpExpressionNode

#dump

Methods inherited from TagExpressionNode

#==, #dump, #evaluate, #maybe_fallback, #maybe_glob, #maybe_query, #maybe_query_without_condition, #optimize, #separator?, #tagname?, #tagvalue?, #to_glob

Methods inherited from ExpressionNode

#==, #compact, #dump, #evaluate, #optimize

Constructor Details

#initialize(tagname, separator = nil, options = {}) ⇒ RegexpHostOrTagNode

Returns a new instance of RegexpHostOrTagNode.



1163
1164
1165
# File 'lib/hotdog/expression/semantics.rb', line 1163

def initialize(tagname, separator=nil, options={})
  super(tagname, nil, separator, options)
end

Instance Method Details

#condition(options = {}) ⇒ Object



1167
1168
1169
# File 'lib/hotdog/expression/semantics.rb', line 1167

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

#condition_tables(options = {}) ⇒ Object



1171
1172
1173
# File 'lib/hotdog/expression/semantics.rb', line 1171

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

#condition_values(options = {}) ⇒ Object



1175
1176
1177
# File 'lib/hotdog/expression/semantics.rb', line 1175

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