Class: Infobeep::SMSRequest
- Inherits:
-
BaseRequestModel
- Object
- Model
- BaseRequestModel
- Infobeep::SMSRequest
- Defined in:
- lib/infobeep/requests/sms_request.rb
Instance Method Summary collapse
- #hash_attributes ⇒ Object
- #http_method ⇒ Object
- #payload ⇒ Object
- #response_class ⇒ Object
- #route ⇒ Object
Methods inherited from BaseRequestModel
Instance Method Details
#hash_attributes ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/infobeep/requests/sms_request.rb', line 15 def hash_attributes h = super h[:destinations] = [] h[:destinations] = h[:destinations] + destinations.collect{ |destination| destination.hash_attributes } unless to.empty? h[:destinations] << {to: to} end h.delete(:to) h end |
#http_method ⇒ Object
30 31 32 |
# File 'lib/infobeep/requests/sms_request.rb', line 30 def http_method :post end |
#payload ⇒ Object
34 35 36 37 38 |
# File 'lib/infobeep/requests/sms_request.rb', line 34 def payload bulk_sms_request = Infobeep::BulkSMSRequest.new bulk_sms_request. = [self] bulk_sms_request.payload end |
#response_class ⇒ Object
40 41 42 |
# File 'lib/infobeep/requests/sms_request.rb', line 40 def response_class SMSResponse end |
#route ⇒ Object
26 27 28 |
# File 'lib/infobeep/requests/sms_request.rb', line 26 def route 'sms/1/text/advanced' end |