class Rack::ReverseProxyRule

Attributes

rule[R]
url[R]

Public Class Methods

new(rule) click to toggle source
# File lib/rack/reverse_proxy_rule.rb, line 4
def initialize rule
  if rule.kind_of?(Proc) || rule.respond_to?(:call)
    @rule = rule
  else
    raise "Invalid Rule for reverse_proxy"
  end
end

Public Instance Methods

get_uri() click to toggle source
# File lib/rack/reverse_proxy_rule.rb, line 18
def get_uri
  return nil if @url.nil?
  URI.parse(@url)
end
match?(env) click to toggle source
# File lib/rack/reverse_proxy_rule.rb, line 14
def match? env
  @url = @rule.call env
end