Class: Sendly::SuggestedReply

Inherits:
Object
  • Object
show all
Defined in:
lib/sendly/types.rb

Overview

Suggested Replies

Constant Summary collapse

TONES =
%w[professional friendly concise].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#textString (readonly)

Returns Suggested reply text.

Returns:

  • (String)

    Suggested reply text



605
606
607
# File 'lib/sendly/types.rb', line 605

def text
  @text
end

#toneString (readonly)

Returns Tone of the suggestion (professional, friendly, concise).

Returns:

  • (String)

    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_hObject



617
618
619
# File 'lib/sendly/types.rb', line 617

def to_h
  { text: text, tone: tone }.compact
end