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 ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
- #initialize(host = 'localhost', port = 21420) ⇒ Uri constructor
-
#to_s ⇒ String
The host and port as a single value.
Constructor Details
#initialize(host = 'localhost', port = 21420) ⇒ Uri
15 16 17 18 |
# File 'lib/vedeu/distributed/uri.rb', line 15 def initialize(host = 'localhost', port = 21420) @host = host || 'localhost' @port = port || 21420 end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
10 11 12 |
# File 'lib/vedeu/distributed/uri.rb', line 10 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
10 11 12 |
# File 'lib/vedeu/distributed/uri.rb', line 10 def port @port end |
Instance Method Details
#to_s ⇒ String
Returns The host and port as a single value.
24 25 26 |
# File 'lib/vedeu/distributed/uri.rb', line 24 def to_s ['druby://', host, ':', port].join end |