Class: Tlapse::Server
- Inherits:
-
Object
- Object
- Tlapse::Server
- Defined in:
- lib/tlapse/server.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#port ⇒ Object
Returns the value of attribute port.
Instance Method Summary collapse
- #full_host ⇒ Object
-
#initialize(host: "localhost", port: 9000) ⇒ Server
constructor
A new instance of Server.
- #serve ⇒ Object
Constructor Details
#initialize(host: "localhost", port: 9000) ⇒ Server
Returns a new instance of Server.
7 8 9 10 |
# File 'lib/tlapse/server.rb', line 7 def initialize(host: "localhost", port: 9000) @host = host @port = port end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
5 6 7 |
# File 'lib/tlapse/server.rb', line 5 def host @host end |
#port ⇒ Object
Returns the value of attribute port.
5 6 7 |
# File 'lib/tlapse/server.rb', line 5 def port @port end |
Instance Method Details
#full_host ⇒ Object
17 18 19 |
# File 'lib/tlapse/server.rb', line 17 def full_host "druby://#{@host}:#{@port}" end |
#serve ⇒ Object
12 13 14 15 |
# File 'lib/tlapse/server.rb', line 12 def serve DRb.start_service full_host, drb_object DRb.thread.join # wait for commands end |