Class: Vedeu::Distributed::Uri Private

Inherits:
Object
  • Object
show all
Defined in:
lib/vedeu/distributed/uri.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host = 'localhost', port = 21_420) ⇒ Vedeu::Distributed::Uri

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Vedeu::Distributed::Uri.

Parameters:

  • host (String) (defaults to: 'localhost')

    Hostname or IP address.

  • port (Fixnum|String) (defaults to: 21_420)


30
31
32
33
# File 'lib/vedeu/distributed/uri.rb', line 30

def initialize(host = 'localhost', port = 21_420)
  @host = host || 'localhost'
  @port = port || 21_420
end

Instance Attribute Details

#hostString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


19
20
21
# File 'lib/vedeu/distributed/uri.rb', line 19

def host
  @host
end

#portFixnum|String (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Fixnum|String)


23
24
25
# File 'lib/vedeu/distributed/uri.rb', line 23

def port
  @port
end

Instance Method Details

#to_sString Also known as: to_str

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns The host and port as a single value.

Examples:

'druby://localhost:21420'

Returns:

  • (String)

    The host and port as a single value.



39
40
41
# File 'lib/vedeu/distributed/uri.rb', line 39

def to_s
  "druby://#{host}:#{port}"
end