class Service::Proxy::Config
Attributes
config[R]
Public Class Methods
new(config = {})
click to toggle source
# File lib/service/proxy/config.rb, line 6 def initialize(config = {}) @config = config || {} end
Public Instance Methods
proxied_paths_matcher()
click to toggle source
# File lib/service/proxy/config.rb, line 10 def proxied_paths_matcher @proxied_paths_matcher ||= Regexp.union(services.collect(&:path_regexp)) end
service_matching_path(path)
click to toggle source
# File lib/service/proxy/config.rb, line 14 def service_matching_path(path) services.detect { |service| service.path_regexp =~ path } end
services()
click to toggle source
# File lib/service/proxy/config.rb, line 18 def services @services ||= config.fetch(:services, {}).map { |k, v| ServiceConfig.new(k, v) } end