class Service::Proxy::ServiceConfig

Public Class Methods

new(name, options) click to toggle source
# File lib/service/proxy/service_config.rb, line 4
def initialize(name, options)
  @name = name
  @options = options
end

Public Instance Methods

backend() click to toggle source
# File lib/service/proxy/service_config.rb, line 9
def backend
  @backend ||= URI(@options.fetch(:backend, ''))
end
backend_path_for(original_path) click to toggle source
# File lib/service/proxy/service_config.rb, line 13
def backend_path_for(original_path)
  original_path.delete_prefix!(path)
  [backend.path, original_path].compact.join('/').gsub(/\/+/, '/')
end
path() click to toggle source
# File lib/service/proxy/service_config.rb, line 18
def path
  @path ||= @options.fetch(:path)
end
path_regexp() click to toggle source
# File lib/service/proxy/service_config.rb, line 22
def path_regexp
  @path_regexp ||= Regexp.new("^#{Regexp.escape(path)}")
end
read_timeout() click to toggle source
# File lib/service/proxy/service_config.rb, line 34
def read_timeout
  @options.fetch(:read_timeout, nil)
end
send_cookies?() click to toggle source
# File lib/service/proxy/service_config.rb, line 26
def send_cookies?
  @options.fetch(:forward_cookies, true)
end
verify_ssl?() click to toggle source
# File lib/service/proxy/service_config.rb, line 30
def verify_ssl?
  @options.fetch(:verify_ssl, true)
end