Class: Vedeu::Distributed::Uri
- Inherits:
-
Object
- Object
- Vedeu::Distributed::Uri
- Defined in:
- lib/vedeu/distributed/uri.rb
Overview
Value class which provides the host and port for the DRb server and client.
Instance Attribute Summary collapse
- #host ⇒ String readonly
- #port ⇒ Fixnum|String readonly
Instance Method Summary collapse
-
#initialize(host = 'localhost', port = 21_420) ⇒ Vedeu::Distributed::Uri
constructor
Returns a new instance of Vedeu::Distributed::Uri.
-
#to_s ⇒ String
(also: #to_str)
The host and port as a single value.
Constructor Details
#initialize(host = 'localhost', port = 21_420) ⇒ Vedeu::Distributed::Uri
Returns a new instance of Vedeu::Distributed::Uri.
28 29 30 31 |
# File 'lib/vedeu/distributed/uri.rb', line 28 def initialize(host = 'localhost', port = 21_420) @host = host || 'localhost' @port = port || 21_420 end |
Instance Attribute Details
#host ⇒ String (readonly)
17 18 19 |
# File 'lib/vedeu/distributed/uri.rb', line 17 def host @host end |
#port ⇒ Fixnum|String (readonly)
21 22 23 |
# File 'lib/vedeu/distributed/uri.rb', line 21 def port @port end |
Instance Method Details
#to_s ⇒ String Also known as: to_str
Returns The host and port as a single value.
37 38 39 |
# File 'lib/vedeu/distributed/uri.rb', line 37 def to_s "druby://#{host}:#{port}" end |