Class: Aws::Endpoints::URL Private
- Inherits:
-
Object
- Object
- Aws::Endpoints::URL
- Defined in:
- lib/aws-sdk-core/endpoints/url.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #authority ⇒ Object readonly private
- #is_ip ⇒ Object readonly private
- #normalized_path ⇒ Object readonly private
- #path ⇒ Object readonly private
- #scheme ⇒ Object readonly private
Instance Method Summary collapse
- #as_json(_options = {}) ⇒ Object private
-
#initialize(url) ⇒ URL
constructor
private
A new instance of URL.
Constructor Details
#initialize(url) ⇒ URL
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of URL.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/aws-sdk-core/endpoints/url.rb', line 10 def initialize(url) uri = URI(url) @scheme = uri.scheme # only support http and https schemes raise ArgumentError unless %w[https http].include?(@scheme) # do not support query raise ArgumentError if uri.query @authority = (url, uri) @path = uri.path @normalized_path = uri.path + (uri.path[-1] == '/' ? '' : '/') @is_ip = _is_ip(uri.host) end |
Instance Attribute Details
#authority ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 |
# File 'lib/aws-sdk-core/endpoints/url.rb', line 26 def @authority end |
#is_ip ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 |
# File 'lib/aws-sdk-core/endpoints/url.rb', line 29 def is_ip @is_ip end |
#normalized_path ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
28 29 30 |
# File 'lib/aws-sdk-core/endpoints/url.rb', line 28 def normalized_path @normalized_path end |
#path ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
27 28 29 |
# File 'lib/aws-sdk-core/endpoints/url.rb', line 27 def path @path end |
#scheme ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 |
# File 'lib/aws-sdk-core/endpoints/url.rb', line 25 def scheme @scheme end |
Instance Method Details
#as_json(_options = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
31 32 33 34 35 36 37 38 39 |
# File 'lib/aws-sdk-core/endpoints/url.rb', line 31 def as_json( = {}) { 'scheme' => scheme, 'authority' => , 'path' => path, 'normalizedPath' => normalized_path, 'isIp' => is_ip } end |