Class: Hotdog::Expression::RegexpHostNode
- Inherits:
-
RegexpExpressionNode
- Object
- ExpressionNode
- TagExpressionNode
- RegexpExpressionNode
- Hotdog::Expression::RegexpHostNode
- Defined in:
- lib/hotdog/expression/semantics.rb
Instance Attribute Summary
Attributes inherited from TagExpressionNode
#separator, #tag_name, #tag_value
Instance Method Summary collapse
- #condition(options = {}) ⇒ Object
- #condition_tables(options = {}) ⇒ Object
- #condition_values(options = {}) ⇒ Object
-
#initialize(tag_value, separator = nil) ⇒ RegexpHostNode
constructor
A new instance of RegexpHostNode.
Methods inherited from RegexpExpressionNode
Methods inherited from TagExpressionNode
#==, #dump, #evaluate, #maybe_fallback, #maybe_glob, #maybe_query, #maybe_query_without_condition, #optimize, #reload, #separator?, #tag_name?, #tag_value?, #to_glob
Methods inherited from ExpressionNode
Constructor Details
#initialize(tag_value, separator = nil) ⇒ RegexpHostNode
Returns a new instance of RegexpHostNode.
999 1000 1001 1002 1003 1004 1005 |
# File 'lib/hotdog/expression/semantics.rb', line 999 def initialize(tag_value, separator=nil) case tag_value when /\A\/(.*)\/\z/ tag_value = $1 end super("host", tag_value, separator) end |
Instance Method Details
#condition(options = {}) ⇒ Object
1007 1008 1009 |
# File 'lib/hotdog/expression/semantics.rb', line 1007 def condition(={}) "hosts.name REGEXP ?" end |
#condition_tables(options = {}) ⇒ Object
1011 1012 1013 |
# File 'lib/hotdog/expression/semantics.rb', line 1011 def condition_tables(={}) [:hosts] end |
#condition_values(options = {}) ⇒ Object
1015 1016 1017 |
# File 'lib/hotdog/expression/semantics.rb', line 1015 def condition_values(={}) [tag_value] end |