Class: Shatter::Web::Application

Inherits:
Object
  • Object
show all
Includes:
Concurrent::Async
Defined in:
lib/shatter/web/application.rb

Instance Method Summary collapse

Instance Method Details

#response_for(uuid) ⇒ Object



11
12
13
14
15
16
# File 'lib/shatter/web/application.rb', line 11

def response_for(uuid)
  client = service_client(Shatter::Service::Discovery.service_instance_url_for_uuid(uuid))
  return if client.nil?

  client.response_for(uuid)
end

#route(uuid, path, params) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/shatter/web/application.rb', line 18

def route(uuid, path, params)
  operation = operation_for(path)
  return unknown_operation(uuid) if operation.nil?

  client = service_client
  client.send(operation.to_sym, params.merge(uuid:))
rescue StandardError => e
  error_response(uuid, e)
end