Class: ZnyxSdk::DetectorResult

Inherits:
Object
  • Object
show all
Defined in:
lib/znyx_sdk/models.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ DetectorResult

Returns a new instance of DetectorResult.



48
49
50
51
52
53
54
# File 'lib/znyx_sdk/models.rb', line 48

def initialize(data)
  @detector_name = data["detector_name"]
  @decision      = data["decision"]
  @risk_score    = data["risk_score"].to_i
  @latency_ms    = data["latency_ms"].to_i
  @rule_hits     = Array(data["rule_hits"]).map { |h| RuleHit.new(h) }
end

Instance Attribute Details

#decisionObject (readonly)

Returns the value of attribute decision.



46
47
48
# File 'lib/znyx_sdk/models.rb', line 46

def decision
  @decision
end

#detector_nameObject (readonly)

Returns the value of attribute detector_name.



46
47
48
# File 'lib/znyx_sdk/models.rb', line 46

def detector_name
  @detector_name
end

#latency_msObject (readonly)

Returns the value of attribute latency_ms.



46
47
48
# File 'lib/znyx_sdk/models.rb', line 46

def latency_ms
  @latency_ms
end

#risk_scoreObject (readonly)

Returns the value of attribute risk_score.



46
47
48
# File 'lib/znyx_sdk/models.rb', line 46

def risk_score
  @risk_score
end

#rule_hitsObject (readonly)

Returns the value of attribute rule_hits.



46
47
48
# File 'lib/znyx_sdk/models.rb', line 46

def rule_hits
  @rule_hits
end