Sha256: db7a0c2ad3893f657018b1788eac8e56ab26fb5560bc08ffa1325e813a4eb0da

Contents?: true

Size: 660 Bytes

Versions: 2

Compression:

Stored size: 660 Bytes

Contents

module Vedeu

  module Distributed

    # Value class which provides the host and port for the DRb server and
    # client.
    #
    class Uri

      attr_reader :host, :port

      # @param host [String] Hostname or IP address.
      # @param port [Fixnum|String]
      # @return [Uri]
      def initialize(host = 'localhost', port = 21420)
        @host = host || 'localhost'
        @port = port || 21420
      end

      # @example
      #   'druby://localhost:21420'
      #
      # @return [String] The host and port as a single value.
      def to_s
        ['druby://', host, ':', port].join
      end

    end # Uri

  end # Distributed

end # Vedeu

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.4.5 lib/vedeu/distributed/uri.rb
vedeu-0.4.4 lib/vedeu/distributed/uri.rb