Class: LocalPac::ProxyPac::ResultParser::PacResultHtmlStylist
- Inherits:
-
Object
- Object
- LocalPac::ProxyPac::ResultParser::PacResultHtmlStylist
- Defined in:
- lib/local_pac/proxy_pac/result_parser.rb
Instance Attribute Summary collapse
-
#class_proxy ⇒ Object
readonly
Returns the value of attribute class_proxy.
-
#class_proxy_port ⇒ Object
readonly
Returns the value of attribute class_proxy_port.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ PacResultHtmlStylist
constructor
A new instance of PacResultHtmlStylist.
- #style_me(result) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ PacResultHtmlStylist
Returns a new instance of PacResultHtmlStylist.
8 9 10 11 12 |
# File 'lib/local_pac/proxy_pac/result_parser.rb', line 8 def initialize( = {}) @class_request_type = .fetch(:class_request_type, 'lp_request_type') @class_proxy = .fetch(:class_proxy, 'lp_proxy') @class_proxy_port = .fetch(:class_proxy_port, 'lp_proxy_port') end |
Instance Attribute Details
#class_proxy ⇒ Object (readonly)
Returns the value of attribute class_proxy.
6 7 8 |
# File 'lib/local_pac/proxy_pac/result_parser.rb', line 6 def class_proxy @class_proxy end |
#class_proxy_port ⇒ Object (readonly)
Returns the value of attribute class_proxy_port.
6 7 8 |
# File 'lib/local_pac/proxy_pac/result_parser.rb', line 6 def class_proxy_port @class_proxy_port end |
Instance Method Details
#style_me(result) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/local_pac/proxy_pac/result_parser.rb', line 14 def style_me(result) styled_result = [] styled_result << span(result.request_type, class_request_type) if result.request_type styled_result << " " if result.proxy || result.proxy_port styled_result << span(result.proxy, class_proxy) if result.proxy if result.proxy_port styled_result << ':' styled_result << span(result.proxy_port, class_proxy_port) end result.styled_content = styled_content.join end |