Class: Sendly::SuggestedReply
- Inherits:
-
Object
- Object
- Sendly::SuggestedReply
- Defined in:
- lib/sendly/types.rb
Overview
Suggested Replies
Constant Summary collapse
- TONES =
%w[professional friendly concise].freeze
Instance Attribute Summary collapse
-
#text ⇒ String
readonly
Suggested reply text.
-
#tone ⇒ String
readonly
Tone of the suggestion (professional, friendly, concise).
Instance Method Summary collapse
-
#initialize(data) ⇒ SuggestedReply
constructor
A new instance of SuggestedReply.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ SuggestedReply
Returns a new instance of SuggestedReply.
612 613 614 615 |
# File 'lib/sendly/types.rb', line 612 def initialize(data) @text = data["text"] @tone = data["tone"] end |
Instance Attribute Details
#text ⇒ String (readonly)
Returns Suggested reply text.
605 606 607 |
# File 'lib/sendly/types.rb', line 605 def text @text end |
#tone ⇒ String (readonly)
Returns Tone of the suggestion (professional, friendly, concise).
608 609 610 |
# File 'lib/sendly/types.rb', line 608 def tone @tone end |
Instance Method Details
#to_h ⇒ Object
617 618 619 |
# File 'lib/sendly/types.rb', line 617 def to_h { text: text, tone: tone }.compact end |