Class: Sendly::RcsMessageDetails
- Inherits:
-
Object
- Object
- Sendly::RcsMessageDetails
- Defined in:
- lib/sendly/rcs_resource.rb
Overview
RCS-specific details on a sent message. On a native RCS delivery kind
is what was sent ("text" or "card") and agent_name is the brand name
recipients see. On an SMS fallback requested_channel is "rcs" and
suggestions_dropped is true when suggested replies/actions were
dropped (they have no SMS form).
Constant Summary collapse
- KINDS =
%w[text card].freeze
Instance Attribute Summary collapse
-
#agent_id ⇒ Object
readonly
Returns the value of attribute agent_id.
-
#agent_name ⇒ Object
readonly
Returns the value of attribute agent_name.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#requested_channel ⇒ Object
readonly
Returns the value of attribute requested_channel.
-
#suggestions_dropped ⇒ Object
readonly
Returns the value of attribute suggestions_dropped.
Instance Method Summary collapse
-
#initialize(data) ⇒ RcsMessageDetails
constructor
A new instance of RcsMessageDetails.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ RcsMessageDetails
Returns a new instance of RcsMessageDetails.
73 74 75 76 77 78 79 |
# File 'lib/sendly/rcs_resource.rb', line 73 def initialize(data) @kind = data["kind"] @agent_id = data["agentId"] || data["agent_id"] @agent_name = data["agentName"] || data["agent_name"] @requested_channel = data["requestedChannel"] || data["requested_channel"] @suggestions_dropped = data["suggestionsDropped"] || data["suggestions_dropped"] || false end |
Instance Attribute Details
#agent_id ⇒ Object (readonly)
Returns the value of attribute agent_id.
68 69 70 |
# File 'lib/sendly/rcs_resource.rb', line 68 def agent_id @agent_id end |
#agent_name ⇒ Object (readonly)
Returns the value of attribute agent_name.
68 69 70 |
# File 'lib/sendly/rcs_resource.rb', line 68 def agent_name @agent_name end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
68 69 70 |
# File 'lib/sendly/rcs_resource.rb', line 68 def kind @kind end |
#requested_channel ⇒ Object (readonly)
Returns the value of attribute requested_channel.
68 69 70 |
# File 'lib/sendly/rcs_resource.rb', line 68 def requested_channel @requested_channel end |
#suggestions_dropped ⇒ Object (readonly)
Returns the value of attribute suggestions_dropped.
68 69 70 |
# File 'lib/sendly/rcs_resource.rb', line 68 def suggestions_dropped @suggestions_dropped end |
Instance Method Details
#to_h ⇒ Object
81 82 83 84 85 86 87 |
# File 'lib/sendly/rcs_resource.rb', line 81 def to_h { kind: kind, agent_id: agent_id, agent_name: agent_name, requested_channel: requested_channel, suggestions_dropped: suggestions_dropped }.compact end |