Class: EMRPC::Server
- Inherits:
-
Object
- Object
- EMRPC::Server
- Defined in:
- lib/emrpc/server.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#object ⇒ Object
Returns the value of attribute object.
-
#port ⇒ Object
Returns the value of attribute port.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Server
constructor
A new instance of Server.
- #run ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Server
Returns a new instance of Server.
4 5 6 7 8 9 |
# File 'lib/emrpc/server.rb', line 4 def initialize( = {}) @host = [:host] @port = [:port] @object = [:object] @protocol = [:protocol] || ServerProtocol end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
3 4 5 |
# File 'lib/emrpc/server.rb', line 3 def host @host end |
#object ⇒ Object
Returns the value of attribute object.
3 4 5 |
# File 'lib/emrpc/server.rb', line 3 def object @object end |
#port ⇒ Object
Returns the value of attribute port.
3 4 5 |
# File 'lib/emrpc/server.rb', line 3 def port @port end |
#protocol ⇒ Object
Returns the value of attribute protocol.
3 4 5 |
# File 'lib/emrpc/server.rb', line 3 def protocol @protocol end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 |
# File 'lib/emrpc/server.rb', line 11 def run EventMachine.start_server(@host, @port, @protocol) do |conn| conn.__served_object = @object end end |