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) ⇒ Uri
constructor
Returns a new instance of Vedeu::Distributed::Uri.
-
#to_s ⇒ String
The host and port as a single value.
Constructor Details
#initialize(host = 'localhost', port = 21_420) ⇒ Uri
Returns a new instance of Vedeu::Distributed::Uri.
22 23 24 25 |
# File 'lib/vedeu/distributed/uri.rb', line 22 def initialize(host = 'localhost', port = 21_420) @host = host || 'localhost' @port = port || 21_420 end |
Instance Attribute Details
#host ⇒ String (readonly)
11 12 13 |
# File 'lib/vedeu/distributed/uri.rb', line 11 def host @host end |
#port ⇒ Fixnum|String (readonly)
15 16 17 |
# File 'lib/vedeu/distributed/uri.rb', line 15 def port @port end |
Instance Method Details
#to_s ⇒ String
Returns The host and port as a single value.
31 32 33 |
# File 'lib/vedeu/distributed/uri.rb', line 31 def to_s ['druby://', host, ':', port].join end |