Class: Hotdog::Commands::Search::StringHostNode
- Inherits:
-
StringExpressionNode
- Object
- ExpressionNode
- TagExpressionNode
- StringExpressionNode
- Hotdog::Commands::Search::StringHostNode
- 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(attribute, separator = nil) ⇒ StringHostNode
constructor
A new instance of StringHostNode.
- #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(attribute, separator = nil) ⇒ StringHostNode
Returns a new instance of StringHostNode.
974 975 976 |
# File 'lib/hotdog/commands/search.rb', line 974 def initialize(attribute, separator=nil) super("host", attribute, separator) end |
Instance Method Details
#condition(options = {}) ⇒ Object
978 979 980 |
# File 'lib/hotdog/commands/search.rb', line 978 def condition(={}) "hosts.name = ?" end |
#condition_tables(options = {}) ⇒ Object
982 983 984 |
# File 'lib/hotdog/commands/search.rb', line 982 def condition_tables(={}) [:hosts] end |
#condition_values(options = {}) ⇒ Object
986 987 988 |
# File 'lib/hotdog/commands/search.rb', line 986 def condition_values(={}) [attribute] end |
#maybe_fallback(options = {}) ⇒ Object
990 991 992 993 994 995 996 997 998 |
# File 'lib/hotdog/commands/search.rb', line 990 def maybe_fallback(={}) fallback = GlobHostNode.new(to_glob(attribute), separator) query = fallback.maybe_query() if query QueryExpressionNode.new(query, fallback.condition_values()) else nil end end |