Class: Prevoty::QueryPayload

Inherits:
Object
  • Object
show all
Defined in:
lib/prevoty/query_payload.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ QueryPayload

Returns a new instance of QueryPayload.



8
9
10
11
12
13
14
15
16
17
# File 'lib/prevoty/query_payload.rb', line 8

def initialize(data)
  @product = data[:product]
  @mode = data[:mode]
  @version = data[:version]
  @runtime_version = data[:runtime_version]
  @processed = data[:processed]
  @input = data[:input]
  @result = data[:result]
  @timestamp = data[:timestamp]
end

Instance Attribute Details

#inputObject

Returns the value of attribute input.



5
6
7
# File 'lib/prevoty/query_payload.rb', line 5

def input
  @input
end

#modeObject

Returns the value of attribute mode.



5
6
7
# File 'lib/prevoty/query_payload.rb', line 5

def mode
  @mode
end

#processedObject

Returns the value of attribute processed.



5
6
7
# File 'lib/prevoty/query_payload.rb', line 5

def processed
  @processed
end

#productObject

Returns the value of attribute product.



5
6
7
# File 'lib/prevoty/query_payload.rb', line 5

def product
  @product
end

#resultObject

Returns the value of attribute result.



5
6
7
# File 'lib/prevoty/query_payload.rb', line 5

def result
  @result
end

#runtime_versionObject

Returns the value of attribute runtime_version.



5
6
7
# File 'lib/prevoty/query_payload.rb', line 5

def runtime_version
  @runtime_version
end

#timestampObject

Returns the value of attribute timestamp.



5
6
7
# File 'lib/prevoty/query_payload.rb', line 5

def timestamp
  @timestamp
end

#versionObject

Returns the value of attribute version.



5
6
7
# File 'lib/prevoty/query_payload.rb', line 5

def version
  @version
end

Instance Method Details

#to_jsonObject



19
20
21
22
23
24
# File 'lib/prevoty/query_payload.rb', line 19

def to_json
  return {
    product: @product, mode: @mode, version: @version,
    input: @input, result: @result, timestamp: @timestamp
  }.to_json
end