Skip to content

Commit

Permalink
added missing defs for new methods in URI::HTTP
Browse files Browse the repository at this point in the history
  • Loading branch information
HoneyryderChuck committed Feb 4, 2022
1 parent 203e7ec commit 753e1c7
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions stdlib/uri/0/http.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,41 @@ module URI
def self.build: (Array[String | Integer] args) -> URI::HTTP
| ({ userinfo: String, host: String, port: Integer, path: String, query: String, fragment: String }) -> URI::HTTP

# <!--
# rdoc-file=lib/uri/http.rb
# - authority()
# -->
# ## Description
#
# Returns the authority for an HTTP uri, as defined in
# https://datatracker.ietf.org/doc/html/rfc3986/#section-3.2.
#
# Example:
#
# URI::HTTP.build(host: 'www.example.com', path: '/foo/bar').authority #=> "www.example.com"
# URI::HTTP.build(host: 'www.example.com', port: 8000, path: '/foo/bar').authority #=> "www.example.com:8000"
# URI::HTTP.build(host: 'www.example.com', port: 80, path: '/foo/bar').authority #=> "www.example.com"
#
def authority: () -> String

# <!--
# rdoc-file=lib/uri/http.rb
# - origin()
# -->
# ## Description
#
# Returns the origin for an HTTP uri, as defined in
# https://datatracker.ietf.org/doc/html/rfc6454.
#
# Example:
#
# URI::HTTP.build(host: 'www.example.com', path: '/foo/bar').origin #=> "http://www.example.com"
# URI::HTTP.build(host: 'www.example.com', port: 8000, path: '/foo/bar').origin #=> "http://www.example.com:8000"
# URI::HTTP.build(host: 'www.example.com', port: 80, path: '/foo/bar').origin #=> "http://www.example.com"
# URI::HTTPS.build(host: 'www.example.com', path: '/foo/bar').origin #=> "https://www.example.com"
#
def origin: () -> String

# <!--
# rdoc-file=lib/uri/http.rb
# - request_uri()
Expand Down

0 comments on commit 753e1c7

Please sign in to comment.