Class: Datadog::AppSec::WAF::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/appsec/waf/result.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, events:, actions:, attributes:, duration:, timeout:, keep:) ⇒ Result

Returns a new instance of Result.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/datadog/appsec/waf/result.rb', line 11

def initialize(status:, events:, actions:, attributes:, duration:, timeout:, keep:)
  @status = status
  @events = events
  @actions = actions
  @attributes = attributes
  @duration = duration

  @keep = !!keep
  @timeout = !!timeout
  @input_truncated = false
end

Instance Attribute Details

#actionsObject (readonly)

Returns the value of attribute actions.



9
10
11
# File 'lib/datadog/appsec/waf/result.rb', line 9

def actions
  @actions
end

#attributesObject (readonly)

Returns the value of attribute attributes.



9
10
11
# File 'lib/datadog/appsec/waf/result.rb', line 9

def attributes
  @attributes
end

#durationObject (readonly)

Returns the value of attribute duration.



9
10
11
# File 'lib/datadog/appsec/waf/result.rb', line 9

def duration
  @duration
end

#eventsObject (readonly)

Returns the value of attribute events.



9
10
11
# File 'lib/datadog/appsec/waf/result.rb', line 9

def events
  @events
end

#statusObject (readonly)

Returns the value of attribute status.



9
10
11
# File 'lib/datadog/appsec/waf/result.rb', line 9

def status
  @status
end

Instance Method Details

#input_truncated?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/datadog/appsec/waf/result.rb', line 35

def input_truncated?
  @input_truncated
end

#keep?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/datadog/appsec/waf/result.rb', line 31

def keep?
  @keep
end

#mark_input_truncated!Object



23
24
25
# File 'lib/datadog/appsec/waf/result.rb', line 23

def mark_input_truncated!
  @input_truncated = true
end

#timeout?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/datadog/appsec/waf/result.rb', line 27

def timeout?
  @timeout
end

#to_hObject



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/datadog/appsec/waf/result.rb', line 39

def to_h
  {
    status: @status,
    events: @events,
    actions: @actions,
    attributes: @attributes,
    duration: @duration,
    keep: @keep,
    timeout: @timeout,
    input_truncated: @input_truncated
  }
end