class Pacproxy::Config
Pacproxy::Config
represent configuration for Pacproxy
Constants
- DEFAULT_CONFIG
Attributes
config[R]
Public Class Methods
new()
click to toggle source
# File lib/pacproxy/config.rb, line 17 def initialize @config = DEFAULT_CONFIG self end
Public Instance Methods
read_config(yaml_file)
click to toggle source
# File lib/pacproxy/config.rb, line 27 def read_config(yaml_file) return {} unless yaml_file return {} unless File.exist?(yaml_file) YAML.load(File.read(yaml_file)) end
update(yaml_file = 'pacproxy.yml')
click to toggle source
# File lib/pacproxy/config.rb, line 22 def update(yaml_file = 'pacproxy.yml') @config.merge!(read_config(yaml_file)) self end