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, #tag_name, #tag_value
Instance Method Summary collapse
- #condition(options = {}) ⇒ Object
- #condition_tables(options = {}) ⇒ Object
- #condition_values(options = {}) ⇒ Object
-
#initialize(tag_name, 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?, #tag_name?, #tag_value?, #to_glob
Methods inherited from ExpressionNode
Constructor Details
#initialize(tag_name, separator = nil) ⇒ RegexpTagNameNode
Returns a new instance of RegexpTagNameNode.
1035 1036 1037 1038 1039 1040 1041 |
# File 'lib/hotdog/expression/semantics.rb', line 1035 def initialize(tag_name, separator=nil) case tag_name when /\A\/(.*)\/\z/ tag_name = $1 end super(tag_name.to_s, nil, separator) end |
Instance Method Details
#condition(options = {}) ⇒ Object
1043 1044 1045 |
# File 'lib/hotdog/expression/semantics.rb', line 1043 def condition(={}) "tags.name REGEXP ?" end |
#condition_tables(options = {}) ⇒ Object
1047 1048 1049 |
# File 'lib/hotdog/expression/semantics.rb', line 1047 def condition_tables(={}) [:tags] end |
#condition_values(options = {}) ⇒ Object
1051 1052 1053 |
# File 'lib/hotdog/expression/semantics.rb', line 1051 def condition_values(={}) [tag_name] end |