Class: SerwerSMS::Resources::Messages
- Inherits:
-
Object
- Object
- SerwerSMS::Resources::Messages
- Defined in:
- lib/serwersms/resources/messages.rb
Instance Method Summary collapse
-
#delete(id, unique_id = nil) ⇒ Hash
Delete message from the scheduler.
-
#initialize(client) ⇒ Messages
constructor
A new instance of Messages.
-
#received(type, params = {}) ⇒ Hash
List of received messages.
-
#reports(params = {}) ⇒ Hash
Check message delivery reports.
-
#send_mms(phone, title, params = {}) ⇒ Hash
Send MMS.
-
#send_nd(phone, text) ⇒ Hash
Send message to ND/SC number.
-
#send_ndi(phone, text, ndi_number) ⇒ Hash
Send message to NDI/SCI number.
-
#send_personalized(messages, sender = nil, params = {}) ⇒ Hash
Send personalized messages.
-
#send_sms(phone, text, sender = nil, params = {}) ⇒ Hash
Send SMS message.
-
#send_voice(phone, params = {}) ⇒ Hash
Send Voice message.
-
#view(id, params = {}) ⇒ Hash
View single message.
Constructor Details
#initialize(client) ⇒ Messages
Returns a new instance of Messages.
4 5 6 |
# File 'lib/serwersms/resources/messages.rb', line 4 def initialize(client) @client = client end |
Instance Method Details
#delete(id, unique_id = nil) ⇒ Hash
Delete message from the scheduler
223 224 225 |
# File 'lib/serwersms/resources/messages.rb', line 223 def delete(id, unique_id = nil) @client.call('messages/delete', 'id' => id, 'unique_id' => unique_id) end |
#received(type, params = {}) ⇒ Hash
List of received messages
212 213 214 215 |
# File 'lib/serwersms/resources/messages.rb', line 212 def received(type, params = {}) params['type'] = type @client.call('messages/received', params) end |
#reports(params = {}) ⇒ Hash
Check message delivery reports
182 183 184 |
# File 'lib/serwersms/resources/messages.rb', line 182 def reports(params = {}) @client.call('messages/reports', params) end |
#send_mms(phone, title, params = {}) ⇒ Hash
Send MMS
108 109 110 111 112 |
# File 'lib/serwersms/resources/messages.rb', line 108 def send_mms(phone, title, params = {}) params['phone'] = phone params['title'] = title @client.call('messages/send_mms', params) end |
#send_nd(phone, text) ⇒ Hash
Send message to ND/SC number
120 121 122 |
# File 'lib/serwersms/resources/messages.rb', line 120 def send_nd(phone, text) @client.call('messages/send_nd', 'phone' => phone, 'text' => text) end |
#send_ndi(phone, text, ndi_number) ⇒ Hash
Send message to NDI/SCI number
131 132 133 |
# File 'lib/serwersms/resources/messages.rb', line 131 def send_ndi(phone, text, ndi_number) @client.call('messages/send_ndi', 'phone' => phone, 'text' => text, 'ndi_number' => ndi_number) end |
#send_personalized(messages, sender = nil, params = {}) ⇒ Hash
Send personalized messages
67 68 69 70 71 |
# File 'lib/serwersms/resources/messages.rb', line 67 def send_personalized(, sender = nil, params = {}) params['messages'] = params['sender'] = sender @client.call('messages/send_personalized', params) end |
#send_sms(phone, text, sender = nil, params = {}) ⇒ Hash
Send SMS message
38 39 40 41 42 43 |
# File 'lib/serwersms/resources/messages.rb', line 38 def send_sms(phone, text, sender = nil, params = {}) params['phone'] = phone params['text'] = text params['sender'] = sender @client.call('messages/send_sms', params) end |
#send_voice(phone, params = {}) ⇒ Hash
Send Voice message
88 89 90 91 |
# File 'lib/serwersms/resources/messages.rb', line 88 def send_voice(phone, params = {}) params['phone'] = phone @client.call('messages/send_voice', params) end |
#view(id, params = {}) ⇒ Hash
View single message
157 158 159 160 |
# File 'lib/serwersms/resources/messages.rb', line 157 def view(id, params = {}) params['id'] = id @client.call('messages/view', params) end |