Class: Sendly::TenDlcAssignment
- Inherits:
-
Object
- Object
- Sendly::TenDlcAssignment
- Defined in:
- lib/sendly/tendlc_resource.rb
Overview
A phone number assigned to a campaign. The number can send once the
status is "Active".
Instance Attribute Summary collapse
-
#assigned_at ⇒ Object
readonly
Returns the value of attribute assigned_at.
-
#campaign_id ⇒ Object
readonly
Returns the value of attribute campaign_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#phone_number ⇒ Object
readonly
Returns the value of attribute phone_number.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #active? ⇒ Boolean
-
#initialize(data) ⇒ TenDlcAssignment
constructor
A new instance of TenDlcAssignment.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ TenDlcAssignment
Returns a new instance of TenDlcAssignment.
139 140 141 142 143 144 145 |
# File 'lib/sendly/tendlc_resource.rb', line 139 def initialize(data) @id = data["id"] @campaign_id = data["campaignId"] || data["campaign_id"] @phone_number = data["phoneNumber"] || data["phone_number"] @status = data["status"] @assigned_at = data["assignedAt"] || data["assigned_at"] end |
Instance Attribute Details
#assigned_at ⇒ Object (readonly)
Returns the value of attribute assigned_at.
137 138 139 |
# File 'lib/sendly/tendlc_resource.rb', line 137 def assigned_at @assigned_at end |
#campaign_id ⇒ Object (readonly)
Returns the value of attribute campaign_id.
137 138 139 |
# File 'lib/sendly/tendlc_resource.rb', line 137 def campaign_id @campaign_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
137 138 139 |
# File 'lib/sendly/tendlc_resource.rb', line 137 def id @id end |
#phone_number ⇒ Object (readonly)
Returns the value of attribute phone_number.
137 138 139 |
# File 'lib/sendly/tendlc_resource.rb', line 137 def phone_number @phone_number end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
137 138 139 |
# File 'lib/sendly/tendlc_resource.rb', line 137 def status @status end |
Instance Method Details
#active? ⇒ Boolean
147 148 149 |
# File 'lib/sendly/tendlc_resource.rb', line 147 def active? status == "Active" end |
#to_h ⇒ Object
151 152 153 154 155 156 |
# File 'lib/sendly/tendlc_resource.rb', line 151 def to_h { id: id, campaign_id: campaign_id, phone_number: phone_number, status: status, assigned_at: assigned_at }.compact end |