Class: URI::HTTP
- Inherits:
-
Object
- Object
- URI::HTTP
- Defined in:
- lib/uri.rb
Constant Summary collapse
- REGEX =
/([^:]+):\/\/([^\/])\/([^?]*)\??(.*)/
Instance Method Summary collapse
-
#initialize(url) ⇒ HTTP
constructor
A new instance of HTTP.
- #to_s ⇒ Object
Constructor Details
#initialize(url) ⇒ HTTP
Returns a new instance of HTTP.
7 8 9 10 11 12 13 14 15 |
# File 'lib/uri.rb', line 7 def initialize(url) @url = url uri_match = url.match(REGEX).to_a @scheme = uri_match[1] @host = uri_match[2] @path = uri_match[3] @query = uri_match[4] # TODO fragment end |
Instance Method Details
#to_s ⇒ Object
17 18 19 |
# File 'lib/uri.rb', line 17 def to_s url end |