Class: Hotdog::Expression::RegexpTagNode
- Inherits:
-
RegexpExpressionNode
- Object
- ExpressionNode
- TagExpressionNode
- RegexpExpressionNode
- Hotdog::Expression::RegexpTagNode
- 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(tagname, tagvalue, separator = nil, options = {}) ⇒ RegexpTagNode
constructor
A new instance of RegexpTagNode.
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(tagname, tagvalue, separator = nil, options = {}) ⇒ RegexpTagNode
Returns a new instance of RegexpTagNode.
1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 |
# File 'lib/hotdog/expression/semantics.rb', line 1093 def initialize(tagname, tagvalue, separator=nil, ={}) case tagname when /\A\/(.*)\/\z/ tagname = $1 end case tagvalue when /\A\/(.*)\/\z/ tagvalue = $1 end super(tagname, tagvalue, separator, ) end |
Instance Method Details
#condition(options = {}) ⇒ Object
1105 1106 1107 |
# File 'lib/hotdog/expression/semantics.rb', line 1105 def condition(={}) "tags.name REGEXP ? AND tags.value REGEXP ?" end |
#condition_tables(options = {}) ⇒ Object
1109 1110 1111 |
# File 'lib/hotdog/expression/semantics.rb', line 1109 def condition_tables(={}) [:tags] end |
#condition_values(options = {}) ⇒ Object
1113 1114 1115 |
# File 'lib/hotdog/expression/semantics.rb', line 1113 def condition_values(={}) [tagname, tagvalue] end |