Class: QuickAndRuby::Proxy::EnvParser
- Inherits:
-
Object
- Object
- QuickAndRuby::Proxy::EnvParser
- Defined in:
- lib/quick_and_ruby/proxy/env_parser.rb
Overview
service parse env for proxy exe
Constant Summary collapse
- INDEX_TO_KEY =
{ 3 => :user, 4 => :proxy_host, 5 => :proxy_port }.freeze
Instance Method Summary collapse
-
#initialize(env = ENV) ⇒ EnvParser
constructor
A new instance of EnvParser.
- #parse ⇒ Object
Constructor Details
#initialize(env = ENV) ⇒ EnvParser
Returns a new instance of EnvParser.
12 13 14 |
# File 'lib/quick_and_ruby/proxy/env_parser.rb', line 12 def initialize(env = ENV) @env = env end |
Instance Method Details
#parse ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/quick_and_ruby/proxy/env_parser.rb', line 16 def parse parsed = _parsed_proxy return {} unless parsed INDEX_TO_KEY.each_with_object({}) do |(index, key), | [key] = parsed[index] if parsed[index] end end |