Class: Barrister::Containers::IntraProcess
- Inherits:
-
Object
- Object
- Barrister::Containers::IntraProcess
- Defined in:
- lib/barrister-intraprocess.rb
Instance Method Summary collapse
-
#initialize(json_path, service_klass, interface_name = nil) ⇒ IntraProcess
constructor
A new instance of IntraProcess.
- #process(message) ⇒ Object
Constructor Details
#initialize(json_path, service_klass, interface_name = nil) ⇒ IntraProcess
Returns a new instance of IntraProcess.
9 10 11 12 13 |
# File 'lib/barrister-intraprocess.rb', line 9 def initialize(json_path, service_klass, interface_name=nil) contract = Barrister::contract_from_file(json_path) @server = Barrister::Server.new(contract) @server.add_handler(interface_name || service_klass.to_s, service_klass.new) end |
Instance Method Details
#process(message) ⇒ Object
15 16 17 |
# File 'lib/barrister-intraprocess.rb', line 15 def process() @server.handle() end |