Class: MockServer::A2A::WebhookTarget Private
- Inherits:
-
Struct
- Object
- Struct
- MockServer::A2A::WebhookTarget
- Defined in:
- lib/mockserver/a2a.rb
Overview
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.
Resolved components of a push-notification webhook URL.
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#path ⇒ Object
Returns the value of attribute path.
-
#port ⇒ Object
Returns the value of attribute port.
-
#secure ⇒ Object
Returns the value of attribute secure.
Class Method Summary collapse
- .parse(url) ⇒ Object private
Instance Method Summary collapse
- #host_header ⇒ Object private
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host
82 83 84 |
# File 'lib/mockserver/a2a.rb', line 82 def host @host end |
#path ⇒ Object
Returns the value of attribute path
82 83 84 |
# File 'lib/mockserver/a2a.rb', line 82 def path @path end |
#port ⇒ Object
Returns the value of attribute port
82 83 84 |
# File 'lib/mockserver/a2a.rb', line 82 def port @port end |
#secure ⇒ Object
Returns the value of attribute secure
82 83 84 |
# File 'lib/mockserver/a2a.rb', line 82 def secure @secure end |
Class Method Details
.parse(url) ⇒ 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.
87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/mockserver/a2a.rb', line 87 def self.parse(url) uri = URI.parse(url) secure = uri.scheme.to_s.downcase == 'https' host = uri.host raise ArgumentError, "Invalid push-notification webhook URL (no host): #{url}" if host.nil? || host.empty? port = uri.port || (secure ? 443 : 80) path = uri.path path = '/' if path.nil? || path.empty? new(host, port, secure, path) end |
Instance Method Details
#host_header ⇒ 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.
83 84 85 |
# File 'lib/mockserver/a2a.rb', line 83 def host_header "#{host}:#{port}" end |