Sha256: 8e199444ac8c40f7c8df4ee5c67ce661bd50330fa6c2db95db8a4f26a01a3f24

Contents?: true

Size: 996 Bytes

Versions: 51

Compression:

Stored size: 996 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}".freeze
      end
      alias_method :to_str, :to_s

    end # Uri

  end # Distributed

end # Vedeu

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
vedeu-0.8.0 lib/vedeu/distributed/uri.rb
vedeu-0.7.4 lib/vedeu/distributed/uri.rb
vedeu-0.7.3 lib/vedeu/distributed/uri.rb
vedeu-0.7.2 lib/vedeu/distributed/uri.rb
vedeu-0.7.1 lib/vedeu/distributed/uri.rb
vedeu-0.7.0 lib/vedeu/distributed/uri.rb
vedeu-0.6.71 lib/vedeu/distributed/uri.rb
vedeu-0.6.70 lib/vedeu/distributed/uri.rb
vedeu-0.6.69 lib/vedeu/distributed/uri.rb
vedeu-0.6.68 lib/vedeu/distributed/uri.rb
vedeu-0.6.67 lib/vedeu/distributed/uri.rb
vedeu-0.6.66 lib/vedeu/distributed/uri.rb
vedeu-0.6.65 lib/vedeu/distributed/uri.rb
vedeu-0.6.64 lib/vedeu/distributed/uri.rb
vedeu-0.6.63 lib/vedeu/distributed/uri.rb
vedeu-0.6.62 lib/vedeu/distributed/uri.rb
vedeu-0.6.61 lib/vedeu/distributed/uri.rb
vedeu-0.6.60 lib/vedeu/distributed/uri.rb
vedeu-0.6.59 lib/vedeu/distributed/uri.rb
vedeu-0.6.58 lib/vedeu/distributed/uri.rb