Class: Sendly::RcsCapability
- Inherits:
-
Object
- Object
- Sendly::RcsCapability
- Defined in:
- lib/sendly/rcs_resource.rb
Overview
Whether a recipient's device and network can receive RCS. When
capable is false, a text send to this recipient falls back to plain
SMS (unless the fallback is disabled) and a card send fails. features
lists the feature tags the device reports.
Instance Attribute Summary collapse
-
#agent_id ⇒ Object
readonly
Returns the value of attribute agent_id.
-
#capable ⇒ Object
readonly
Returns the value of attribute capable.
-
#features ⇒ Object
readonly
Returns the value of attribute features.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
- #capable? ⇒ Boolean
-
#initialize(data) ⇒ RcsCapability
constructor
A new instance of RcsCapability.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ RcsCapability
Returns a new instance of RcsCapability.
46 47 48 49 50 51 |
# File 'lib/sendly/rcs_resource.rb', line 46 def initialize(data) @to = data["to"] @agent_id = data["agentId"] || data["agent_id"] @capable = data["capable"] || false @features = data["features"] || [] end |
Instance Attribute Details
#agent_id ⇒ Object (readonly)
Returns the value of attribute agent_id.
44 45 46 |
# File 'lib/sendly/rcs_resource.rb', line 44 def agent_id @agent_id end |
#capable ⇒ Object (readonly)
Returns the value of attribute capable.
44 45 46 |
# File 'lib/sendly/rcs_resource.rb', line 44 def capable @capable end |
#features ⇒ Object (readonly)
Returns the value of attribute features.
44 45 46 |
# File 'lib/sendly/rcs_resource.rb', line 44 def features @features end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
44 45 46 |
# File 'lib/sendly/rcs_resource.rb', line 44 def to @to end |
Instance Method Details
#capable? ⇒ Boolean
53 54 55 |
# File 'lib/sendly/rcs_resource.rb', line 53 def capable? capable end |
#to_h ⇒ Object
57 58 59 |
# File 'lib/sendly/rcs_resource.rb', line 57 def to_h { to: to, agent_id: agent_id, capable: capable, features: features }.compact end |