Module: ActionSms::ConnectionAdapters::TestHelpers::SMSGlobal
- Defined in:
- lib/action_sms/connection_adapters/test_helpers/sms_global.rb
Instance Method Summary collapse
- #sample_configuration(options = {}) ⇒ Object
- #sample_delivery_receipt(options = {}) ⇒ Object
- #sample_delivery_response(options = {}) ⇒ Object
- #sample_delivery_response_with_message_id(message_id, options = {}) ⇒ Object
- #sample_incoming_sms(options = {}) ⇒ Object
- #sample_message_id(options = {}) ⇒ Object
Instance Method Details
#sample_configuration(options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/action_sms/connection_adapters/test_helpers/sms_global.rb', line 6 def sample_configuration( = {}) config = { :adapter => "sms_global", :user => "SMSGlobal Username", :password => "SMSGlobal Password" } config.merge!( :authentication_key => "My Unique Authentication Key" ) if [:authentication_key] config end |
#sample_delivery_receipt(options = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/action_sms/connection_adapters/test_helpers/sms_global.rb', line 18 def sample_delivery_receipt( = {}) [:message_id] ||= "6942744494999745" [:message_id].gsub!("SMSGlobalMsgID:", "") [:status] ||= "DELIVRD" [:error] ||= "000" [:date] ||= "1005132312" { "msgid"=> [:message_id], "dlrstatus"=> [:status], "dlr_err"=> [:error], "donedate"=> [:date] } end |
#sample_delivery_response(options = {}) ⇒ Object
32 33 34 35 36 |
# File 'lib/action_sms/connection_adapters/test_helpers/sms_global.rb', line 32 def sample_delivery_response( = {}) [:failed] ||= false [:message_id] ||= "6942744494999745" [:failed] ? "ERROR: No action requested" : "OK: 0; Sent queued message ID: 86b1a945370734f4 #{sample_message_id(:message_id => options[:message_id])}" end |
#sample_delivery_response_with_message_id(message_id, options = {}) ⇒ Object
38 39 40 41 |
# File 'lib/action_sms/connection_adapters/test_helpers/sms_global.rb', line 38 def (, = {}) .merge!(:message_id => ) sample_delivery_response() end |
#sample_incoming_sms(options = {}) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/action_sms/connection_adapters/test_helpers/sms_global.rb', line 43 def sample_incoming_sms( = {}) [:message] ||= "Endia kasdf ofeao" [:to] ||= "61447100308" [:from] ||= "61447100399" [:date] ||= "2010-05-13 23:59:11" sample = { "to" => [:to], "from" => [:from], "msg"=> [:message], "date" => [:date] } sample.merge!( "authentication_key" => @config[:authentication_key] ) if [:authentic] sample end |
#sample_message_id(options = {}) ⇒ Object
60 61 62 63 |
# File 'lib/action_sms/connection_adapters/test_helpers/sms_global.rb', line 60 def ( = {}) [:message_id] ||= "6942744494999745" "SMSGlobalMsgID:#{options[:message_id]}" end |