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.
1006 1007 1008 |
# File 'lib/hotdog/commands/search.rb', line 1006 def initialize(identifier, separator=nil) super(identifier, nil, separator) end |
Instance Method Details
#condition(options = {}) ⇒ Object
1010 1011 1012 |
# File 'lib/hotdog/commands/search.rb', line 1010 def condition(={}) "tags.name = ?" end |
#condition_tables(options = {}) ⇒ Object
1014 1015 1016 |
# File 'lib/hotdog/commands/search.rb', line 1014 def condition_tables(={}) [:tags] end |
#condition_values(options = {}) ⇒ Object
1018 1019 1020 |
# File 'lib/hotdog/commands/search.rb', line 1018 def condition_values(={}) [identifier] end |
#maybe_fallback(options = {}) ⇒ Object
1022 1023 1024 1025 1026 1027 1028 1029 |
# File 'lib/hotdog/commands/search.rb', line 1022 def maybe_fallback(={}) fallback = GlobTagNameNode.new(to_glob(identifier), separator) if query = fallback.maybe_query() QueryExpressionNode.new(query, fallback.condition_values()) else nil end end |