Class: Hotdog::Commands::Search::GlobTagValueNode
Instance Attribute Summary
#attribute, #identifier, #separator
Instance Method Summary
collapse
#dump
#==, #attribute?, #dump, #evaluate, #identifier?, #maybe_glob, #maybe_query, #maybe_query_without_condition, #optimize, #reload, #separator?, #to_glob
#dump, #evaluate, #intermediates, #leafs, #optimize
Constructor Details
#initialize(attribute, separator = nil) ⇒ GlobTagValueNode
1209
1210
1211
|
# File 'lib/hotdog/commands/search.rb', line 1209
def initialize(attribute, separator=nil)
super(nil, attribute, separator)
end
|
Instance Method Details
#condition(options = {}) ⇒ Object
1213
1214
1215
|
# File 'lib/hotdog/commands/search.rb', line 1213
def condition(options={})
"LOWER(hosts.name) GLOB LOWER(?) OR LOWER(tags.value) GLOB LOWER(?)"
end
|
#condition_tables(options = {}) ⇒ Object
1217
1218
1219
|
# File 'lib/hotdog/commands/search.rb', line 1217
def condition_tables(options={})
[:hosts, :tags]
end
|
#condition_values(options = {}) ⇒ Object
1221
1222
1223
|
# File 'lib/hotdog/commands/search.rb', line 1221
def condition_values(options={})
[attribute, attribute]
end
|
#maybe_fallback(options = {}) ⇒ Object
1225
1226
1227
1228
1229
1230
1231
1232
1233
|
# File 'lib/hotdog/commands/search.rb', line 1225
def maybe_fallback(options={})
fallback = GlobTagValueNode.new(to_glob(attribute), separator)
query = fallback.maybe_query(options)
if query
QueryExpressionNode.new(query, fallback.condition_values(options))
else
nil
end
end
|