Class: EventHookClientServer::Server::RequestProcessor

Inherits:
EventHookClientServer::Service show all
Defined in:
lib/event_hook_client_server/server/request_processor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from EventHookClientServer::Service

call

Constructor Details

#initialize(method, input, request, handler, logger) ⇒ RequestProcessor

Returns a new instance of RequestProcessor.



17
18
19
20
21
22
23
24
# File 'lib/event_hook_client_server/server/request_processor.rb', line 17

def initialize(method, input, request, handler, logger)
  @method = method
  @input = input
  @request = request
  @handler = handler
  @logger = logger
  @id = SecureRandom.uuid
end

Instance Attribute Details

#handlerObject (readonly)

Returns the value of attribute handler.



13
14
15
# File 'lib/event_hook_client_server/server/request_processor.rb', line 13

def handler
  @handler
end

#idObject (readonly)

Returns the value of attribute id.



15
16
17
# File 'lib/event_hook_client_server/server/request_processor.rb', line 15

def id
  @id
end

#inputObject (readonly)

Returns the value of attribute input.



11
12
13
# File 'lib/event_hook_client_server/server/request_processor.rb', line 11

def input
  @input
end

#loggerObject (readonly)

Returns the value of attribute logger.



14
15
16
# File 'lib/event_hook_client_server/server/request_processor.rb', line 14

def logger
  @logger
end

#methodObject (readonly)

Returns the value of attribute method.



10
11
12
# File 'lib/event_hook_client_server/server/request_processor.rb', line 10

def method
  @method
end

#requestObject (readonly)

Returns the value of attribute request.



12
13
14
# File 'lib/event_hook_client_server/server/request_processor.rb', line 12

def request
  @request
end

Instance Method Details

#callObject



26
27
28
29
30
31
32
# File 'lib/event_hook_client_server/server/request_processor.rb', line 26

def call
  start_timer!
  log_start
  result = handler.call(input, request)
  log_end
  result
end