Sha256: 67d5c9b62cef7d53f5596eadee2b817033fc36782ab6e04336f8b293b6278a4b
Contents?: true
Size: 867 Bytes
Versions: 6
Compression:
Stored size: 867 Bytes
Contents
module SmsBroker module Client module Response class TwilioSuccess < Success def initialize(twilio_response) super :twilio, twilio_response, serialize(twilio_response) end private def serialize(response) { to: response.to, from: response.from, message_id: response.sid, raw: response_to_hash(response) } end def response_to_hash(response) attributes = %i( to sid uri from body price status price_unit error_code account_sid api_version date_created error_message messaging_service_sid ) {}.tap do |hash| attributes.each do |attr| hash[attr] = response.send(attr) end end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems