lib/smsified/reporting.rb in smsified-0.1.3 vs lib/smsified/reporting.rb in smsified-0.1.4
- old
+ new
@@ -14,10 +14,11 @@
# @option params [optional, String] :sender_address to use with subscriptions
# @option params [optional, Boolean] :debug to turn on the HTTparty debugging to stdout
# @example
# subscription = Subscription.new :username => 'user', :password => '123'
def initialize(options)
+ raise ArgumentError, 'an options Hash is required' if !options.instance_of?(Hash)
raise ArgumentError, ':username required' if options[:username].nil?
raise ArgumentError, ':password required' if options[:password].nil?
self.class.debug_output $stdout if options[:debug]
self.class.base_uri options[:base_uri] || SMSIFIED_ONEAPI_PUBLIC_URI
@@ -36,9 +37,10 @@
# @return [Object] A Response Object with http and data instance methods
# @raise [ArgumentError] of :sender_address is not passed here when not passed on instantiating the object
# @example
# one_api.delivery_status :request_id => 'f359193765f6a3149ca76a4508e21234', :sender_address => '14155551212'
def delivery_status(options)
+ raise ArgumentError, 'an options Hash is required' if !options.instance_of?(Hash)
raise ArgumentError, ':sender_address is required' if options[:sender_address].nil? && @sender_address.nil?
options[:sender_address] = options[:sender_address] || @sender_address
Response.new self.class.get("/smsmessaging/outbound/#{options[:sender_address]}/requests/#{options[:request_id]}/deliveryInfos", :basic_auth => @auth)
\ No newline at end of file