lib/sms_notify/api.rb in cdyne-sms-notify-0.8.4 vs lib/sms_notify/api.rb in cdyne-sms-notify-0.8.5
- old
+ new
@@ -43,11 +43,11 @@
command.execute({:PhoneNumber => phone_number, :Message => message})
)[:sms_return]
)
end
- # Implements +GetSMSStatus+[http://ws.cdyne.com/SmsWS/SMS.asmx?op=GetSMSStatus]
+ # Implements +GetSMSStatus+[http://ws.cdyne.com/SmsWS/SMS.asmx?op=GetSMSStatus].
#
# == Required Attributes
# * text_id
#
# Returns an #MessageStatus object.
@@ -61,12 +61,23 @@
command.execute({:TextID => text_id})
)[:sms_return]
)
end
- def message_response(text_id)
+ # Implements +GetSMSResponse+[http://ws.cdyne.com/SmsWS/SMS.asmx?op=GetSMSResponse].
+ #
+ # == Required Attributes
+ # * text_id
+ #
+ # Returns an array of #MessageStatus objects.
+ #
+ # == Example:
+ # @api.message_response("c7d8a")
+ def message_responses(text_id)
command = Command.new('GetSMSResponse', license_key)
- MessageResponse.new(Response.parse(command.execute({:TextID => text_id})))
+ Response.parse( command.execute({:TextID => text_id}) )["ArrayOfSmsResponse"]["SmsResponse"].collect { |r|
+ MessageResponse.new( r )
+ }
end
Dir.glob(File.join(File.dirname(__FILE__), '/api/*')).each do |lib|
require lib
end