Class: Whatsapp::MessageTemplates::Response::QualityScore
- Inherits:
-
Object
- Object
- Whatsapp::MessageTemplates::Response::QualityScore
- Defined in:
- lib/ruby/whatsapp/message_templates/response/quality_score.rb
Overview
A template's quality assessment, derived from usage, recipient feedback and engagement. A falling score is what precedes a PAUSED and then DISABLED status.
Best-effort schema: Meta names the shape (WhatsAppBusinessHSMQualityScoreShape)
in the Graph API reference but does not publish its sub-fields. The three mapped
here are what live responses have been observed to carry. Validate against a real
response before relying on them, as with the best-effort webhook classes in
lib/ruby/whatsapp/webhook/CLAUDE.md.
Source: https://developers.facebook.com/docs/graph-api/reference/whats-app-business-hsm/
Instance Attribute Summary collapse
-
#date ⇒ Integer, ...
When the score was last assessed.
- #reasons ⇒ Array
-
#score ⇒ String?
One of Statuses::QualityScores::ALL.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(score: nil, date: nil, reasons: []) ⇒ QualityScore
constructor
A new instance of QualityScore.
Constructor Details
#initialize(score: nil, date: nil, reasons: []) ⇒ QualityScore
Returns a new instance of QualityScore.
31 32 33 34 35 |
# File 'lib/ruby/whatsapp/message_templates/response/quality_score.rb', line 31 def initialize(score: nil, date: nil, reasons: []) @score = score @date = date @reasons = reasons end |
Instance Attribute Details
#date ⇒ Integer, ...
Returns When the score was last assessed.
22 23 24 |
# File 'lib/ruby/whatsapp/message_templates/response/quality_score.rb', line 22 def date @date end |
#reasons ⇒ Array
26 27 28 |
# File 'lib/ruby/whatsapp/message_templates/response/quality_score.rb', line 26 def reasons @reasons end |
#score ⇒ String?
Returns One of Statuses::QualityScores::ALL.
18 19 20 |
# File 'lib/ruby/whatsapp/message_templates/response/quality_score.rb', line 18 def score @score end |
Class Method Details
.deserialize(data) ⇒ QualityScore
40 41 42 43 44 |
# File 'lib/ruby/whatsapp/message_templates/response/quality_score.rb', line 40 def deserialize(data) data ||= {} new(score: data["score"], date: data["date"], reasons: Array(data["reasons"])) end |