class Hotdog::Expression::StringHostOrTagNode

Public Class Methods

new(tagname, separator=nil, options={}) click to toggle source
# File lib/hotdog/expression/semantics.rb, line 881
def initialize(tagname, separator=nil, options={})
  super(tagname.to_s, nil, separator, options)
end

Public Instance Methods

condition(options={}) click to toggle source
# File lib/hotdog/expression/semantics.rb, line 885
def condition(options={})
  "hosts.name = ? OR tags.name = ? OR tags.value = ?"
end
condition_tables(options={}) click to toggle source
# File lib/hotdog/expression/semantics.rb, line 889
def condition_tables(options={})
  [:hosts, :tags]
end
condition_values(options={}) click to toggle source
# File lib/hotdog/expression/semantics.rb, line 893
def condition_values(options={})
  [tagname, tagname, tagname]
end
maybe_fallback(options={}) click to toggle source
# File lib/hotdog/expression/semantics.rb, line 897
def maybe_fallback(options={})
  fallback = GlobHostOrTagNode.new(to_glob(tagname), separator)
  query = fallback.maybe_query(options)
  if query
    QueryExpressionNode.new(query, fallback.condition_values(options))
  else
    nil
  end
end