Class: Hotdog::Commands::Search::StringTagNameNode
- Inherits:
-
StringExpressionNode
- Object
- ExpressionNode
- TagExpressionNode
- StringExpressionNode
- Hotdog::Commands::Search::StringTagNameNode
- 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, separator = nil) ⇒ StringTagNameNode
constructor
A new instance of StringTagNameNode.
- #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, separator = nil) ⇒ StringTagNameNode
Returns a new instance of StringTagNameNode.
1030 1031 1032 |
# File 'lib/hotdog/commands/search.rb', line 1030 def initialize(identifier, separator=nil) super(identifier, nil, separator) end |
Instance Method Details
#condition(options = {}) ⇒ Object
1034 1035 1036 |
# File 'lib/hotdog/commands/search.rb', line 1034 def condition(={}) "tags.name = ?" end |
#condition_tables(options = {}) ⇒ Object
1038 1039 1040 |
# File 'lib/hotdog/commands/search.rb', line 1038 def condition_tables(={}) [:tags] end |
#condition_values(options = {}) ⇒ Object
1042 1043 1044 |
# File 'lib/hotdog/commands/search.rb', line 1042 def condition_values(={}) [identifier] end |
#maybe_fallback(options = {}) ⇒ Object
1046 1047 1048 1049 1050 1051 1052 1053 1054 |
# File 'lib/hotdog/commands/search.rb', line 1046 def maybe_fallback(={}) fallback = GlobTagNameNode.new(to_glob(identifier), separator) query = fallback.maybe_query() if query QueryExpressionNode.new(query, fallback.condition_values()) else nil end end |