Class: Irumugam::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/irumugam/server.rb

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/irumugam/server.rb', line 3

def call(env)
  request = Rack::Request.new(env)
  contract = ServiceRegistry.find(request)
  body = contract.contract_body if contract.contract_body
  body ||= contract.contract_json.to_json
  [contract.contract_status, {}, body]
end