Class: Hotdog::Expression::GlobNode
Instance Attribute Summary
#separator, #tag_name, #tag_value
Instance Method Summary
collapse
#dump
#==, #dump, #evaluate, #maybe_glob, #maybe_query, #maybe_query_without_condition, #optimize, #reload, #separator?, #tag_name?, #tag_value?, #to_glob
#dump, #evaluate, #optimize
Constructor Details
#initialize(tag_name, separator = nil) ⇒ GlobNode
Returns a new instance of GlobNode.
985
986
987
|
# File 'lib/hotdog/expression/semantics.rb', line 985
def initialize(tag_name, separator=nil)
super(tag_name.to_s, nil, separator)
end
|
Instance Method Details
#condition(options = {}) ⇒ Object
989
990
991
|
# File 'lib/hotdog/expression/semantics.rb', line 989
def condition(options={})
"LOWER(hosts.name) GLOB LOWER(?) OR LOWER(tags.name) GLOB LOWER(?) OR LOWER(tags.value) GLOB LOWER(?)"
end
|
#condition_tables(options = {}) ⇒ Object
993
994
995
|
# File 'lib/hotdog/expression/semantics.rb', line 993
def condition_tables(options={})
[:hosts, :tags]
end
|
#condition_values(options = {}) ⇒ Object
997
998
999
|
# File 'lib/hotdog/expression/semantics.rb', line 997
def condition_values(options={})
[tag_name, tag_name, tag_name]
end
|
#maybe_fallback(options = {}) ⇒ Object
1001
1002
1003
1004
1005
1006
1007
1008
1009
|
# File 'lib/hotdog/expression/semantics.rb', line 1001
def maybe_fallback(options={})
fallback = GlobNode.new(to_glob(tag_name), separator)
query = fallback.maybe_query(options)
if query
QueryExpressionNode.new(query, fallback.condition_values(options))
else
nil
end
end
|