Class: Hotdog::Commands::Search::StringTagNode
- Inherits:
-
StringExpressionNode
- Object
- ExpressionNode
- TagExpressionNode
- StringExpressionNode
- Hotdog::Commands::Search::StringTagNode
- Defined in:
- lib/hotdog/commands/search.rb
Instance Attribute Summary
Attributes inherited from TagExpressionNode
#attribute, #identifier, #separator
Instance Method Summary collapse
- #condition(options = {}) ⇒ Object
- #condition_tables(options = {}) ⇒ Object
- #condition_values(options = {}) ⇒ Object
-
#initialize(identifier, attribute, separator = nil) ⇒ StringTagNode
constructor
A new instance of StringTagNode.
- #maybe_fallback(options = {}) ⇒ Object
Methods inherited from TagExpressionNode
#==, #attribute?, #dump, #evaluate, #identifier?, #maybe_glob, #maybe_query, #maybe_query_without_condition, #optimize, #reload, #separator?, #to_glob
Methods inherited from ExpressionNode
#dump, #evaluate, #intermediates, #leafs, #optimize
Constructor Details
#initialize(identifier, attribute, separator = nil) ⇒ StringTagNode
Returns a new instance of StringTagNode.
979 980 981 |
# File 'lib/hotdog/commands/search.rb', line 979 def initialize(identifier, attribute, separator=nil) super(identifier, attribute, separator) end |
Instance Method Details
#condition(options = {}) ⇒ Object
983 984 985 |
# File 'lib/hotdog/commands/search.rb', line 983 def condition(={}) "tags.name = ? AND tags.value = ?" end |
#condition_tables(options = {}) ⇒ Object
987 988 989 |
# File 'lib/hotdog/commands/search.rb', line 987 def condition_tables(={}) [:tags] end |
#condition_values(options = {}) ⇒ Object
991 992 993 |
# File 'lib/hotdog/commands/search.rb', line 991 def condition_values(={}) [identifier, attribute] end |
#maybe_fallback(options = {}) ⇒ Object
995 996 997 998 999 1000 1001 1002 |
# File 'lib/hotdog/commands/search.rb', line 995 def maybe_fallback(={}) fallback = GlobTagNode.new(to_glob(identifier), to_glob(attribute), separator) if query = fallback.maybe_query() QueryExpressionNode.new(query, fallback.condition_values()) else nil end end |