Class: Twi::Delivery
Overview
The representation of a direct message delivery notification.
Class Method Summary collapse
-
.params_for(id:, status:, code: nil) ⇒ Hash
The shape of the payload send by Twilio to the callback URL.
Instance Method Summary collapse
-
#code ⇒ String?
Error code.
-
#id ⇒ String
Unique identifier.
-
#status ⇒ String
delivery_unknown, delivered, undelivered, failed # TODO: make an enum.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Twi::Resource
Class Method Details
.params_for(id:, status:, code: nil) ⇒ Hash
Returns the shape of the payload send by Twilio to the callback URL.
16 17 18 |
# File 'lib/twi/delivery.rb', line 16 def self.params_for(id:, status:, code: nil) { SmsSid: id, MessageStatus: status, ErrorCode: code } end |
Instance Method Details
#code ⇒ String?
Returns error code.
13 |
# File 'lib/twi/delivery.rb', line 13 def code = @params['ErrorCode'] |
#id ⇒ String
Returns unique identifier.
6 |
# File 'lib/twi/delivery.rb', line 6 def id = @params['SmsSid'] |
#status ⇒ String
delivery_unknown, delivered, undelivered, failed # TODO: make an enum
10 |
# File 'lib/twi/delivery.rb', line 10 def status = @params['MessageStatus'] |