Class: Excon::Addressable::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/excon/addressable/parser.rb

Overview

Parser

Parses a url using ‘Addressable`, setting the port to the inferred_port.

See Also:

  • https://github.com/excon/excon/issues/384#issuecomment-42645517

Class Method Summary collapse

Class Method Details

.parse(url) ⇒ Object



12
13
14
15
16
# File 'lib/excon/addressable/parser.rb', line 12

def self.parse(url)
  uri = ::Addressable::URI.parse(url)
  uri.port = uri.inferred_port unless uri.port
  uri
end