Class: Hotdog::Expression::StringHostNode
- Inherits:
-
StringExpressionNode
- Object
- ExpressionNode
- TagExpressionNode
- StringExpressionNode
- Hotdog::Expression::StringHostNode
- Defined in:
- lib/hotdog/expression/semantics.rb
Instance Attribute Summary
Attributes inherited from TagExpressionNode
#separator, #tagname, #tagvalue
Instance Method Summary collapse
- #condition(options = {}) ⇒ Object
- #condition_tables(options = {}) ⇒ Object
- #condition_values(options = {}) ⇒ Object
-
#initialize(tagvalue, separator = nil, options = {}) ⇒ StringHostNode
constructor
A new instance of StringHostNode.
- #maybe_fallback(options = {}) ⇒ Object
Methods inherited from TagExpressionNode
#==, #dump, #evaluate, #maybe_glob, #maybe_query, #maybe_query_without_condition, #optimize, #separator?, #tagname?, #tagvalue?, #to_glob
Methods inherited from ExpressionNode
#==, #compact, #dump, #evaluate, #optimize
Constructor Details
#initialize(tagvalue, separator = nil, options = {}) ⇒ StringHostNode
Returns a new instance of StringHostNode.
769 770 771 |
# File 'lib/hotdog/expression/semantics.rb', line 769 def initialize(tagvalue, separator=nil, ={}) super("@host", tagvalue.to_s, separator, ) end |
Instance Method Details
#condition(options = {}) ⇒ Object
773 774 775 |
# File 'lib/hotdog/expression/semantics.rb', line 773 def condition(={}) "hosts.name = ?" end |
#condition_tables(options = {}) ⇒ Object
777 778 779 |
# File 'lib/hotdog/expression/semantics.rb', line 777 def condition_tables(={}) [:hosts] end |
#condition_values(options = {}) ⇒ Object
781 782 783 |
# File 'lib/hotdog/expression/semantics.rb', line 781 def condition_values(={}) [tagvalue] end |
#maybe_fallback(options = {}) ⇒ Object
785 786 787 788 789 790 791 792 793 |
# File 'lib/hotdog/expression/semantics.rb', line 785 def maybe_fallback(={}) fallback = GlobHostNode.new(to_glob(tagvalue), separator) query = fallback.maybe_query() if query QueryExpressionNode.new(query, fallback.condition_values()) else nil end end |