module Cupid
class Session
def create_subscriber(email, *args)
options = args.extract_options!
options[:email] = email.to_s
soap_body = '' +
create_subscriber_object(options) +
''
build_request('Create', 'CreateRequest', soap_body)
end
def create_subscribers(*args)
raise NoMethodError.new "I will implement this method soon"
end
private
def create_subscriber_object(options)
subscriber_object = ''
subscriber_object += ''
subscriber_object += '' + options[:client_id].to_s + '' if options[:client_id]
subscriber_object += '' + options[:lists].map(&:list_object).join('') + '' if options[:lists]
subscriber_object += '' + options[:first_name].to_s + '' if options[:first_name]
subscriber_object += '' + options[:last_name].to_s + '' if options[:last_name]
subscriber_object += '' + options[:email] + ''
end
def list_object(list_id)
'
' + list_id.to_s + '
'
end
end
end