class BenchmarkEmailApi::Client

Public Class Methods

new(username,password,api_url) click to toggle source
# File lib/benchmark_email_api.rb, line 9
def initialize(username,password,api_url)
  @server = XMLRPC::Client.new2(api_url)
  $ok, result = @server.call2('login', username, password)
  if $ok
    @token = result
  else
    puts "Error Code: #{result.faultCode}"
    puts "Error Description: #{result.faultString}"
  end
 end

Public Instance Methods

method_missing(api_method, *args) click to toggle source
# File lib/benchmark_email_api.rb, line 19
def method_missing(api_method, *args)
 $ok, result = @server.call2(api_method.to_s, @token, *args)
 return result
end