Sha256: 42678adbc4ee582dd1db7c159e3b0e55c5192905e82ee0372400c2ff7341388b

Contents?: true

Size: 985 Bytes

Versions: 20

Compression:

Stored size: 985 Bytes

Contents

module Vedeu

  # Provides a mechanism to control a running client application via DRb.
  #
  module Distributed

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

      # @!attribute [r] host
      # @return [String]
      attr_reader :host

      # @!attribute [r] port
      # @return [Fixnum|String]
      attr_reader :port

      # Returns a new instance of Vedeu::Distributed::Uri.
      #
      # @param host [String] Hostname or IP address.
      # @param port [Fixnum|String]
      # @return [Vedeu::Distributed::Uri]
      def initialize(host = 'localhost', port = 21_420)
        @host = host || 'localhost'
        @port = port || 21_420
      end

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

    end # Uri

  end # Distributed

end # Vedeu

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
vedeu-0.6.8 lib/vedeu/distributed/uri.rb
vedeu-0.6.7 lib/vedeu/distributed/uri.rb
vedeu-0.6.6 lib/vedeu/distributed/uri.rb
vedeu-0.6.5 lib/vedeu/distributed/uri.rb
vedeu-0.6.4 lib/vedeu/distributed/uri.rb
vedeu-0.6.3 lib/vedeu/distributed/uri.rb
vedeu-0.6.2 lib/vedeu/distributed/uri.rb
vedeu-0.6.1 lib/vedeu/distributed/uri.rb
vedeu-0.6.0 lib/vedeu/distributed/uri.rb
vedeu-0.5.13 lib/vedeu/distributed/uri.rb
vedeu-0.5.12 lib/vedeu/distributed/uri.rb
vedeu-0.5.11 lib/vedeu/distributed/uri.rb
vedeu-0.5.10 lib/vedeu/distributed/uri.rb
vedeu-0.5.9 lib/vedeu/distributed/uri.rb
vedeu-0.5.8 lib/vedeu/distributed/uri.rb
vedeu-0.5.7 lib/vedeu/distributed/uri.rb
vedeu-0.5.6 lib/vedeu/distributed/uri.rb
vedeu-0.5.5 lib/vedeu/distributed/uri.rb
vedeu-0.5.4 lib/vedeu/distributed/uri.rb
vedeu-0.5.3 lib/vedeu/distributed/uri.rb