Class: Hotdog::Expression::RegexpHostNode

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

Returns a new instance of RegexpHostNode.



1071
1072
1073
1074
1075
1076
1077
# File 'lib/hotdog/expression/semantics.rb', line 1071

def initialize(tagvalue, separator=nil, options={})
  case tagvalue
  when /\A\/(.*)\/\z/
    tagvalue = $1
  end
  super("@host", tagvalue, separator, options)
end

Instance Method Details

#condition(options = {}) ⇒ Object



1079
1080
1081
# File 'lib/hotdog/expression/semantics.rb', line 1079

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

#condition_tables(options = {}) ⇒ Object



1083
1084
1085
# File 'lib/hotdog/expression/semantics.rb', line 1083

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

#condition_values(options = {}) ⇒ Object



1087
1088
1089
# File 'lib/hotdog/expression/semantics.rb', line 1087

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