Class: Hotdog::Expression::GlobHostNode
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_value, separator = nil) ⇒ GlobHostNode
Returns a new instance of GlobHostNode.
873
874
875
|
# File 'lib/hotdog/expression/semantics.rb', line 873
def initialize(tag_value, separator=nil)
super("host", tag_value.to_s, separator)
end
|
Instance Method Details
#condition(options = {}) ⇒ Object
877
878
879
|
# File 'lib/hotdog/expression/semantics.rb', line 877
def condition(options={})
"LOWER(hosts.name) GLOB LOWER(?)"
end
|
#condition_tables(options = {}) ⇒ Object
881
882
883
|
# File 'lib/hotdog/expression/semantics.rb', line 881
def condition_tables(options={})
[:hosts]
end
|
#condition_values(options = {}) ⇒ Object
885
886
887
|
# File 'lib/hotdog/expression/semantics.rb', line 885
def condition_values(options={})
[tag_value]
end
|
#maybe_fallback(options = {}) ⇒ Object
889
890
891
892
893
894
895
896
897
|
# File 'lib/hotdog/expression/semantics.rb', line 889
def maybe_fallback(options={})
fallback = GlobHostNode.new(to_glob(tag_value), separator)
query = fallback.maybe_query(options)
if query
QueryExpressionNode.new(query, fallback.condition_values(options))
else
nil
end
end
|