Class: AQL::SMSDeliveryReport
- Inherits:
-
Object
- Object
- AQL::SMSDeliveryReport
- Defined in:
- lib/aql_sms_api.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(params) ⇒ SMSDeliveryReport
constructor
A new instance of SMSDeliveryReport.
Constructor Details
#initialize(params) ⇒ SMSDeliveryReport
Returns a new instance of SMSDeliveryReport.
54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/aql_sms_api.rb', line 54 def initialize(params) @code = params[:reportcode].to_s @destination = params[:destinationnumber].to_s @message = case @code when "1" then "Delivered to Handset" when "2" then "Rejected from Handset" when "4" then "Buffered in transit (phone probably off / out of reception)" when "8" then "Accepted by SMSC" when "16" then "Rejected by SMSC" else "Unknown response code" end end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
52 53 54 |
# File 'lib/aql_sms_api.rb', line 52 def code @code end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
52 53 54 |
# File 'lib/aql_sms_api.rb', line 52 def destination @destination end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
52 53 54 |
# File 'lib/aql_sms_api.rb', line 52 def @message end |