Class: Prevoty::ContentPayload
- Inherits:
-
Object
- Object
- Prevoty::ContentPayload
- Defined in:
- lib/prevoty/content_payload.rb
Instance Attribute Summary collapse
-
#cookies ⇒ Object
Returns the value of attribute cookies.
-
#dest_host ⇒ Object
Returns the value of attribute dest_host.
-
#dest_port ⇒ Object
Returns the value of attribute dest_port.
-
#http_method ⇒ Object
Returns the value of attribute http_method.
-
#input ⇒ Object
Returns the value of attribute input.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#output ⇒ Object
Returns the value of attribute output.
-
#product ⇒ Object
Returns the value of attribute product.
-
#request_url ⇒ Object
Returns the value of attribute request_url.
-
#session_id ⇒ Object
Returns the value of attribute session_id.
-
#src_ip ⇒ Object
Returns the value of attribute src_ip.
-
#statistics ⇒ Object
Returns the value of attribute statistics.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(data) ⇒ ContentPayload
constructor
A new instance of ContentPayload.
- #to_json ⇒ Object
Constructor Details
#initialize(data) ⇒ ContentPayload
Returns a new instance of ContentPayload.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/prevoty/content_payload.rb', line 9 def initialize(data) @timestamp = data[:timestamp] @product = data[:product] @mode = data[:mode] @version = data[:version] @input = data[:input] @output = data[:output] @statistics = data[:statistics] @request_url = data[:request_url] @session_id = data[:session_id] @cookies = data[:cookies] @http_method = data[:http_method] @src_ip = data[:src_ip] @dest_host = data[:dest_host] @dest_port = data[:dest_port] end |
Instance Attribute Details
#cookies ⇒ Object
Returns the value of attribute cookies.
5 6 7 |
# File 'lib/prevoty/content_payload.rb', line 5 def @cookies end |
#dest_host ⇒ Object
Returns the value of attribute dest_host.
5 6 7 |
# File 'lib/prevoty/content_payload.rb', line 5 def dest_host @dest_host end |
#dest_port ⇒ Object
Returns the value of attribute dest_port.
5 6 7 |
# File 'lib/prevoty/content_payload.rb', line 5 def dest_port @dest_port end |
#http_method ⇒ Object
Returns the value of attribute http_method.
5 6 7 |
# File 'lib/prevoty/content_payload.rb', line 5 def http_method @http_method end |
#input ⇒ Object
Returns the value of attribute input.
5 6 7 |
# File 'lib/prevoty/content_payload.rb', line 5 def input @input end |
#mode ⇒ Object
Returns the value of attribute mode.
5 6 7 |
# File 'lib/prevoty/content_payload.rb', line 5 def mode @mode end |
#output ⇒ Object
Returns the value of attribute output.
5 6 7 |
# File 'lib/prevoty/content_payload.rb', line 5 def output @output end |
#product ⇒ Object
Returns the value of attribute product.
5 6 7 |
# File 'lib/prevoty/content_payload.rb', line 5 def product @product end |
#request_url ⇒ Object
Returns the value of attribute request_url.
5 6 7 |
# File 'lib/prevoty/content_payload.rb', line 5 def request_url @request_url end |
#session_id ⇒ Object
Returns the value of attribute session_id.
5 6 7 |
# File 'lib/prevoty/content_payload.rb', line 5 def session_id @session_id end |
#src_ip ⇒ Object
Returns the value of attribute src_ip.
5 6 7 |
# File 'lib/prevoty/content_payload.rb', line 5 def src_ip @src_ip end |
#statistics ⇒ Object
Returns the value of attribute statistics.
5 6 7 |
# File 'lib/prevoty/content_payload.rb', line 5 def statistics @statistics end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
5 6 7 |
# File 'lib/prevoty/content_payload.rb', line 5 def @timestamp end |
#version ⇒ Object
Returns the value of attribute version.
5 6 7 |
# File 'lib/prevoty/content_payload.rb', line 5 def version @version end |
Instance Method Details
#to_json ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/prevoty/content_payload.rb', line 26 def to_json case @mode when 'monitor' return { timestamp: @timestamp, product: @product, mode: @mode, version: @version, input: @input, statistics: @statistics, url: @request_url, session_id: @session_id, cookies: @cookies, http_method: @http_method, src_ip: @src_ip, dest_host: @dest_host, dest_port: @dest_port }.to_json when 'protect' return { timestamp: @timestamp, product: @product, mode: @mode, version: @version, input: @input, output: @output, statistics: @statistics, url: @request_url, session_id: @session_id, cookies: @cookies, http_method: @http_method, src_ip: @src_ip, dest_host: @dest_host, dest_port: @dest_port }.to_json end end |