Class: Pacproxy::PacFile
- Inherits:
-
Object
- Object
- Pacproxy::PacFile
- Includes:
- Loggable
- Defined in:
- lib/pacproxy/pac_file.rb
Overview
Pacproxy::PacFile represent proxy.pac file
Class Attribute Summary collapse
-
.js_lock ⇒ Object
readonly
Returns the value of attribute js_lock.
Instance Method Summary collapse
- #find(uri) ⇒ Object
-
#initialize(file_location, update_interval = 1800) ⇒ PacFile
constructor
A new instance of PacFile.
Methods included from Loggable
#access_logger, #accesslog, #debug, #error, #fatal, #general_logger, #info, #lwarn
Constructor Details
#initialize(file_location, update_interval = 1800) ⇒ PacFile
16 17 18 19 |
# File 'lib/pacproxy/pac_file.rb', line 16 def initialize(file_location, update_interval = 1800) @pac = nil begin_update(file_location, update_interval) end |
Class Attribute Details
.js_lock ⇒ Object (readonly)
Returns the value of attribute js_lock.
13 14 15 |
# File 'lib/pacproxy/pac_file.rb', line 13 def js_lock @js_lock end |
Instance Method Details
#find(uri) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/pacproxy/pac_file.rb', line 21 def find(uri) return 'DIRECT' unless @pac PacFile.js_lock.synchronize do @pac.find(uri) end end |