Class: Atatus::Span::Context::Destination Private
- Inherits:
-
Object
- Object
- Atatus::Span::Context::Destination
- Defined in:
- lib/atatus/span/context/destination.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
- #address ⇒ Object readonly private
- #name ⇒ Object readonly private
- #port ⇒ Object readonly private
- #resource ⇒ Object readonly private
- #type ⇒ Object readonly private
Class Method Summary collapse
- .from_uri(uri_or_str, type: 'external', port: nil) ⇒ Object private
- .only_scheme_and_host(uri_or_str) ⇒ Object private
Instance Method Summary collapse
-
#initialize(name: nil, resource: nil, type: nil, address: nil, port: nil) ⇒ Destination
constructor
private
A new instance of Destination.
Constructor Details
#initialize(name: nil, resource: nil, type: nil, address: nil, port: nil) ⇒ Destination
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 Destination.
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/atatus/span/context/destination.rb', line 25 def initialize( name: nil, resource: nil, type: nil, address: nil, port: nil ) @name = name @resource = resource @type = type @address = address @port = port end |
Instance Attribute Details
#address ⇒ 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.
39 40 41 |
# File 'lib/atatus/span/context/destination.rb', line 39 def address @address end |
#name ⇒ 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.
39 40 41 |
# File 'lib/atatus/span/context/destination.rb', line 39 def name @name end |
#port ⇒ 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.
39 40 41 |
# File 'lib/atatus/span/context/destination.rb', line 39 def port @port end |
#resource ⇒ 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.
39 40 41 |
# File 'lib/atatus/span/context/destination.rb', line 39 def resource @resource end |
#type ⇒ 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.
39 40 41 |
# File 'lib/atatus/span/context/destination.rb', line 39 def type @type end |
Class Method Details
.from_uri(uri_or_str, type: 'external', port: nil) ⇒ 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.
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/atatus/span/context/destination.rb', line 47 def self.from_uri(uri_or_str, type: 'external', port: nil) uri = normalize(uri_or_str) new( name: only_scheme_and_host(uri), resource: "#{uri.host}:#{uri.port}", type: type, address: uri.hostname, port: port || uri.port ) end |
.only_scheme_and_host(uri_or_str) ⇒ 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.
59 60 61 62 63 64 |
# File 'lib/atatus/span/context/destination.rb', line 59 def self.only_scheme_and_host(uri_or_str) uri = normalize(uri_or_str) uri.path = '' uri.password = uri.query = uri.fragment = nil uri.to_s end |