Class: Stealth::Services::BaseMessageHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/stealth/services/base_message_handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params:, headers:) ⇒ BaseMessageHandler

Returns a new instance of BaseMessageHandler.



10
11
12
13
# File 'lib/stealth/services/base_message_handler.rb', line 10

def initialize(params:, headers:)
  @params = params
  @headers = headers
end

Instance Attribute Details

#headersObject (readonly)

Returns the value of attribute headers.



8
9
10
# File 'lib/stealth/services/base_message_handler.rb', line 8

def headers
  @headers
end

#paramsObject (readonly)

Returns the value of attribute params.



8
9
10
# File 'lib/stealth/services/base_message_handler.rb', line 8

def params
  @params
end

Instance Method Details

#coordinateObject

Should respond with a Rack response (github.com/sinatra/sinatra#return-values)



16
17
18
# File 'lib/stealth/services/base_message_handler.rb', line 16

def coordinate
  raise(Stealth::Errors::ServiceImpaired, "Service request handler does not implement 'process'")
end

#processObject

After coordinate responds to the service, an optional async job may be fired that will continue the work via this method



22
23
24
# File 'lib/stealth/services/base_message_handler.rb', line 22

def process

end