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, #tag_name, #tag_value
Instance Method Summary collapse
- #condition(options = {}) ⇒ Object
- #condition_tables(options = {}) ⇒ Object
- #condition_values(options = {}) ⇒ Object
-
#initialize(tag_name, tag_value, separator = nil) ⇒ 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, #reload, #separator?, #tag_name?, #tag_value?, #to_glob
Methods inherited from ExpressionNode
Constructor Details
#initialize(tag_name, tag_value, separator = nil) ⇒ RegexpTagNode
Returns a new instance of RegexpTagNode.
1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 |
# File 'lib/hotdog/expression/semantics.rb', line 1021 def initialize(tag_name, tag_value, separator=nil) case tag_name when /\A\/(.*)\/\z/ tag_name = $1 end case tag_value when /\A\/(.*)\/\z/ tag_value = $1 end super(tag_name, tag_value, separator) end |
Instance Method Details
#condition(options = {}) ⇒ Object
1033 1034 1035 |
# File 'lib/hotdog/expression/semantics.rb', line 1033 def condition(={}) "tags.name REGEXP ? AND tags.value REGEXP ?" end |
#condition_tables(options = {}) ⇒ Object
1037 1038 1039 |
# File 'lib/hotdog/expression/semantics.rb', line 1037 def condition_tables(={}) [:tags] end |
#condition_values(options = {}) ⇒ Object
1041 1042 1043 |
# File 'lib/hotdog/expression/semantics.rb', line 1041 def condition_values(={}) [tag_name, tag_value] end |