Class: Sendly::RcsCapability

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_idObject (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

#capableObject (readonly)

Returns the value of attribute capable.



44
45
46
# File 'lib/sendly/rcs_resource.rb', line 44

def capable
  @capable
end

#featuresObject (readonly)

Returns the value of attribute features.



44
45
46
# File 'lib/sendly/rcs_resource.rb', line 44

def features
  @features
end

#toObject (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

Returns:

  • (Boolean)


53
54
55
# File 'lib/sendly/rcs_resource.rb', line 53

def capable?
  capable
end

#to_hObject



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