Class: ZnyxSdk::DetectorResult
- Inherits:
-
Object
- Object
- ZnyxSdk::DetectorResult
- Defined in:
- lib/znyx_sdk/models.rb
Instance Attribute Summary collapse
-
#decision ⇒ Object
readonly
Returns the value of attribute decision.
-
#detector_name ⇒ Object
readonly
Returns the value of attribute detector_name.
-
#latency_ms ⇒ Object
readonly
Returns the value of attribute latency_ms.
-
#risk_score ⇒ Object
readonly
Returns the value of attribute risk_score.
-
#rule_hits ⇒ Object
readonly
Returns the value of attribute rule_hits.
Instance Method Summary collapse
-
#initialize(data) ⇒ DetectorResult
constructor
A new instance of DetectorResult.
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
#decision ⇒ Object (readonly)
Returns the value of attribute decision.
46 47 48 |
# File 'lib/znyx_sdk/models.rb', line 46 def decision @decision end |
#detector_name ⇒ Object (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_ms ⇒ Object (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_score ⇒ Object (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_hits ⇒ Object (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 |