Class: Hotdog::Expression::RegexpTagvalueNode
- Inherits:
-
RegexpExpressionNode
- Object
- ExpressionNode
- TagExpressionNode
- RegexpExpressionNode
- Hotdog::Expression::RegexpTagvalueNode
- 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 = {}) ⇒ RegexpTagvalueNode
constructor
A new instance of RegexpTagvalueNode.
Methods inherited from RegexpExpressionNode
Methods inherited from TagExpressionNode
#==, #dump, #evaluate, #maybe_fallback, #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 = {}) ⇒ RegexpTagvalueNode
Returns a new instance of RegexpTagvalueNode.
1141 1142 1143 1144 1145 1146 1147 |
# File 'lib/hotdog/expression/semantics.rb', line 1141 def initialize(tagvalue, separator=nil, ={}) case tagvalue when /\A\/(.*)\/\z/ tagvalue = $1 end super(nil, tagvalue.to_s, separator, ) end |
Instance Method Details
#condition(options = {}) ⇒ Object
1149 1150 1151 |
# File 'lib/hotdog/expression/semantics.rb', line 1149 def condition(={}) "hosts.name REGEXP ? OR tags.value REGEXP ?" end |
#condition_tables(options = {}) ⇒ Object
1153 1154 1155 |
# File 'lib/hotdog/expression/semantics.rb', line 1153 def condition_tables(={}) [:hosts, :tags] end |
#condition_values(options = {}) ⇒ Object
1157 1158 1159 |
# File 'lib/hotdog/expression/semantics.rb', line 1157 def condition_values(={}) [tagvalue, tagvalue] end |