Class: Observ::ModerationGuardrailService::Result
- Inherits:
-
Object
- Object
- Observ::ModerationGuardrailService::Result
- Defined in:
- app/services/observ/moderation_guardrail_service.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#priority ⇒ Object
readonly
Returns the value of attribute priority.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Instance Method Summary collapse
- #flagged? ⇒ Boolean
-
#initialize(action:, reason: nil, priority: nil, details: {}) ⇒ Result
constructor
A new instance of Result.
- #passed? ⇒ Boolean
- #skipped? ⇒ Boolean
Constructor Details
#initialize(action:, reason: nil, priority: nil, details: {}) ⇒ Result
Returns a new instance of Result.
25 26 27 28 29 30 |
# File 'app/services/observ/moderation_guardrail_service.rb', line 25 def initialize(action:, reason: nil, priority: nil, details: {}) @action = action @reason = reason @priority = priority @details = details end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
23 24 25 |
# File 'app/services/observ/moderation_guardrail_service.rb', line 23 def action @action end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
23 24 25 |
# File 'app/services/observ/moderation_guardrail_service.rb', line 23 def details @details end |
#priority ⇒ Object (readonly)
Returns the value of attribute priority.
23 24 25 |
# File 'app/services/observ/moderation_guardrail_service.rb', line 23 def priority @priority end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
23 24 25 |
# File 'app/services/observ/moderation_guardrail_service.rb', line 23 def reason @reason end |
Instance Method Details
#flagged? ⇒ Boolean
32 |
# File 'app/services/observ/moderation_guardrail_service.rb', line 32 def flagged? = action == :flagged |
#passed? ⇒ Boolean
34 |
# File 'app/services/observ/moderation_guardrail_service.rb', line 34 def passed? = action == :passed |
#skipped? ⇒ Boolean
33 |
# File 'app/services/observ/moderation_guardrail_service.rb', line 33 def skipped? = action == :skipped |