Module: Prevoty::BuildQueryResult

Included in:
QueryMonitor, QueryHandler
Defined in:
lib/prevoty/build_query_result.rb

Instance Method Summary collapse

Instance Method Details

#build_result(mode, input, result) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/prevoty/build_query_result.rb', line 5

def build_result(mode, input, result)
  data = {
    timestamp: Time.now.utc.strftime('%b %d %Y %H:%M:%S %Z'),
    product: 'query',
    mode: mode,
    version: 1,
    runtime_version: result.engine_version,
    processed: result.processed,
    input: input,
    result: result
  }

  Prevoty::QueryPayload.new(data)
end