Class: Hotdog::Expression::StringTagValueNode
Instance Attribute Summary
#separator, #tag_name, #tag_value
Instance Method Summary
collapse
#==, #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) ⇒ StringTagValueNode
Returns a new instance of StringTagValueNode.
781
782
783
|
# File 'lib/hotdog/expression/semantics.rb', line 781
def initialize(tag_value, separator=nil)
super(nil, tag_value.to_s, separator)
end
|
Instance Method Details
#condition(options = {}) ⇒ Object
785
786
787
|
# File 'lib/hotdog/expression/semantics.rb', line 785
def condition(options={})
"hosts.name = ? OR tags.value = ?"
end
|
#condition_tables(options = {}) ⇒ Object
789
790
791
|
# File 'lib/hotdog/expression/semantics.rb', line 789
def condition_tables(options={})
[:hosts, :tags]
end
|
#condition_values(options = {}) ⇒ Object
793
794
795
|
# File 'lib/hotdog/expression/semantics.rb', line 793
def condition_values(options={})
[tag_value, tag_value]
end
|
#maybe_fallback(options = {}) ⇒ Object
797
798
799
800
801
802
803
804
805
|
# File 'lib/hotdog/expression/semantics.rb', line 797
def maybe_fallback(options={})
fallback = GlobTagValueNode.new(to_glob(tag_value), separator)
query = fallback.maybe_query(options)
if query
QueryExpressionNode.new(query, fallback.condition_values(options))
else
nil
end
end
|