Class: Hotdog::Expression::RegexpTagnameNode

Inherits:
RegexpExpressionNode show all
Defined in:
lib/hotdog/expression/semantics.rb

Instance Attribute Summary

Attributes inherited from TagExpressionNode

#separator, #tagname, #tagvalue

Instance Method Summary collapse

Methods inherited from RegexpExpressionNode

#dump

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, separator = nil, options = {}) ⇒ RegexpTagnameNode

Returns a new instance of RegexpTagnameNode.



1119
1120
1121
1122
1123
1124
1125
# File 'lib/hotdog/expression/semantics.rb', line 1119

def initialize(tagname, separator=nil, options={})
  case tagname
  when /\A\/(.*)\/\z/
    tagname = $1
  end
  super(tagname.to_s, nil, separator, options)
end

Instance Method Details

#condition(options = {}) ⇒ Object



1127
1128
1129
# File 'lib/hotdog/expression/semantics.rb', line 1127

def condition(options={})
  "tags.name REGEXP ?"
end

#condition_tables(options = {}) ⇒ Object



1131
1132
1133
# File 'lib/hotdog/expression/semantics.rb', line 1131

def condition_tables(options={})
  [:tags]
end

#condition_values(options = {}) ⇒ Object



1135
1136
1137
# File 'lib/hotdog/expression/semantics.rb', line 1135

def condition_values(options={})
  [tagname]
end