lib/sms_notify/api.rb in cdyne-sms-notify-0.10.0 vs lib/sms_notify/api.rb in cdyne-sms-notify-0.10.1

- old
+ new

@@ -102,11 +102,11 @@ def message_status(text_id) command = Command.new('GetSMSStatus', license_key) MessageStatus.new( Response.parse( command.execute({:TextID => text_id}) - )[:sms_return] + )["SmsReturn"] ) end # Implements +GetSMSResponse+[http://ws.cdyne.com/SmsWS/SMS.asmx?op=GetSMSResponse]. # @@ -117,10 +117,13 @@ # # == Example: # @api.message_responses("c7d8a") def message_responses(text_id) command = Command.new('GetSMSResponse', license_key) - responses = Response.parse( command.execute({:TextID => text_id}) )["ArrayOfSmsResponse"]["SmsResponse"] + responses = Response.parse( + command.execute({:TextID => text_id}) + )["ArrayOfSmsResponse"]["SmsResponse"] || [] + responses.is_a?(Array) ? responses.collect { |r| MessageResponse.new(r) } : MessageResponse.new(responses) end Dir.glob(File.join(File.dirname(__FILE__), '/api/*')).each do |lib| require lib