Class: HttpStub::Server::Stub::Response::Attribute::Interpolator::Headers
- Inherits:
-
Object
- Object
- HttpStub::Server::Stub::Response::Attribute::Interpolator::Headers
- Defined in:
- lib/http_stub/server/stub/response/attribute/interpolator/headers.rb
Class Method Summary collapse
Class Method Details
.interpolate(value, request) ⇒ Object
14 15 16 17 18 |
# File 'lib/http_stub/server/stub/response/attribute/interpolator/headers.rb', line 14 def self.interpolate(value, request) value.scan(CONTROL_VALUE_REGEXP).flatten.reduce(value) do |result, header_name| result.gsub("control:request.headers[#{header_name}]", request.headers[header_name] || "") end end |