Class: AdditionBehavior
Instance Attribute Summary
Attributes inherited from Behavior
#output_array_for_backend_resp, #output_array_for_hash, #output_array_for_recv
Instance Method Summary
collapse
Methods inherited from Behavior
#delete_symbol
Constructor Details
defaultのbehavior以外はoriginに対してPATHが付加する
124
125
126
127
|
# File 'lib/Behavior.rb', line 124
def initialize(cache_behavior)
super(cache_behavior)
@url = cache_behavior.path_pattern
end
|
Instance Method Details
#store_code_for_backend_resp ⇒ Object
141
142
143
144
145
146
147
148
149
150
151
|
# File 'lib/Behavior.rb', line 141
def store_code_for_backend_resp
@output_array_for_backend_resp << "if(bereq.url ~ \"^(#{@url.gsub(/\*/, ".*")}|#{@url.gsub(/\*/, ".*")}\\?.*)\"){"
super
@output_array_for_backend_resp << "}"
@output_array_for_backend_resp.each_with_index do |code_line, index|
code_line.insert(0, " ")
end
end
|
#store_code_for_hash ⇒ Object
153
154
155
156
157
158
159
160
161
162
163
164
165
|
# File 'lib/Behavior.rb', line 153
def store_code_for_hash
if @forward_headers.items[0] != "*"
@output_array_for_hash << "if(req.url ~ \"^(#{@url.gsub(/\*/, ".*")}|#{@url.gsub(/\*/, ".*")}\\?.*)\"){"
super
@output_array_for_hash << "}"
@output_array_for_hash.each_with_index do |code_line, index|
code_line.insert(0, " ")
end
end
end
|
#store_code_for_recv ⇒ Object
129
130
131
132
133
134
135
136
137
138
139
|
# File 'lib/Behavior.rb', line 129
def store_code_for_recv
@output_array_for_recv << "if(req.url ~ \"^(#{@url.gsub(/\*/, ".*")}|#{@url.gsub(/\*/, ".*")}\\?.*)\"){"
super
@output_array_for_recv << "}"
@output_array_for_recv.each_with_index do |code_line, index|
code_line.insert(0, " ")
end
end
|