Method: Datadog::Core::Utils.extract_host_port
- Defined in:
- lib/datadog/core/utils.rb
.extract_host_port(host_port) ⇒ String, ...
Extracts hostname and port from a string that contains both, separated by ‘:’.
84 85 86 87 88 89 |
# File 'lib/datadog/core/utils.rb', line 84 def self.extract_host_port(host_port) match = /^([^:]+):(\d+)$/.match(host_port) return unless match [match[1], match[2].to_i] end |