Sha256: f1b7be3a52e567b4caf1a5917292c6a0798786d0f7711ca15e754366a507b8ae

Contents?: true

Size: 612 Bytes

Versions: 14

Compression:

Stored size: 612 Bytes

Contents

# frozen_string_literal: true

module Harbr
  class Port # rubocop:disable Style/Documentation
    include Dddr::Entity
    attr_accessor :host_header, :number

    queries do
      # Checks if a port with the specified number exists.
      #
      # Parameters:
      # - number: The port number to check.
      #
      # Returns:
      # - The port object if found, nil otherwise.
      def has_port_number?(number)
        all.find { |port| port.number == number.to_i }
      end

      def assigned_a_port?(host_header)
        all.find { |port| port.host_header == host_header }
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
harbr-0.0.43 lib/harbr/port.rb
harbr-0.0.42 lib/harbr/port.rb
harbr-0.0.40 lib/harbr/port.rb
harbr-0.0.39 lib/harbr/port.rb
harbr-0.0.38 lib/harbr/port.rb
harbr-0.0.37 lib/harbr/port.rb
harbr-0.0.36 lib/harbr/port.rb
harbr-0.0.35 lib/harbr/port.rb
harbr-0.0.34 lib/harbr/port.rb
harbr-0.0.33 lib/harbr/port.rb
harbr-0.0.32 lib/harbr/port.rb
harbr-0.0.31 lib/harbr/port.rb
harbr-0.0.29 lib/harbr/port.rb
harbr-0.0.28 lib/harbr/port.rb