Class: Hotdog::Expression::RegexpTagnameNode
- Inherits:
-
RegexpExpressionNode
- Object
- ExpressionNode
- TagExpressionNode
- RegexpExpressionNode
- Hotdog::Expression::RegexpTagnameNode
- 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, separator = nil) ⇒ RegexpTagnameNode
constructor
A new instance of RegexpTagnameNode.
Methods inherited from RegexpExpressionNode
Methods inherited from TagExpressionNode
#==, #dump, #evaluate, #maybe_fallback, #maybe_glob, #maybe_query, #maybe_query_without_condition, #optimize, #reload, #separator?, #tagname?, #tagvalue?, #to_glob
Methods inherited from ExpressionNode
#==, #dump, #evaluate, #optimize
Constructor Details
#initialize(tagname, separator = nil) ⇒ RegexpTagnameNode
1104 1105 1106 1107 1108 1109 1110 |
# File 'lib/hotdog/expression/semantics.rb', line 1104 def initialize(tagname, separator=nil) case tagname when /\A\/(.*)\/\z/ tagname = $1 end super(tagname.to_s, nil, separator) end |
Instance Method Details
#condition(options = {}) ⇒ Object
1112 1113 1114 |
# File 'lib/hotdog/expression/semantics.rb', line 1112 def condition(={}) "tags.name REGEXP ?" end |
#condition_tables(options = {}) ⇒ Object
1116 1117 1118 |
# File 'lib/hotdog/expression/semantics.rb', line 1116 def condition_tables(={}) [:tags] end |
#condition_values(options = {}) ⇒ Object
1120 1121 1122 |
# File 'lib/hotdog/expression/semantics.rb', line 1120 def condition_values(={}) [tagname] end |