class K8sInternalLb::Endpoint
Attributes
address[R]
port[R]
status[R]
Public Class Methods
new(address:, port:, status:)
click to toggle source
# File lib/k8s_internal_lb/endpoint.rb, line 7 def initialize(address:, port:, status:) self.address = address self.port = port self.status = status end
Public Instance Methods
==(other)
click to toggle source
Equality overriding
# File lib/k8s_internal_lb/endpoint.rb, line 43 def ==(other) return unless other.respond_to?(:address) && other.respond_to?(:port) && other.respond_to?(:status) address == other.address && port == other.port && status == other.status end
address=(address)
click to toggle source
# File lib/k8s_internal_lb/endpoint.rb, line 13 def address=(address) raise ArgumentError, 'Address must be an Address object' unless address.is_a? Address @address = address end
eql?(other)
click to toggle source
# File lib/k8s_internal_lb/endpoint.rb, line 53 def eql?(other) self == other end
hash()
click to toggle source
# File lib/k8s_internal_lb/endpoint.rb, line 49 def hash [address, port, status].hash end
not_ready?()
click to toggle source
# File lib/k8s_internal_lb/endpoint.rb, line 38 def not_ready? @status == :not_ready end
port=(port)
click to toggle source
# File lib/k8s_internal_lb/endpoint.rb, line 19 def port=(port) raise ArgumentError, 'Port must be a Port object' unless port.is_a? Port @port = port end
ready?()
click to toggle source
# File lib/k8s_internal_lb/endpoint.rb, line 34 def ready? @status == :ready end
status=(status)
click to toggle source
# File lib/k8s_internal_lb/endpoint.rb, line 25 def status=(status) status = status ? :ready : :not_ready if [true, false].include? status status = status.to_s.downcase.to_sym raise ArgumentError, 'Status must be one of :ready, :not_ready' unless %i[ready not_ready].include? status @status = status end