Class: BMF::XmlrpcClient

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/bmf/lib/xmlrpc_client.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeXmlrpcClient

Returns a new instance of XmlrpcClient.



10
11
12
# File 'lib/bmf/lib/xmlrpc_client.rb', line 10

def initialize
  initialize_client
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object



18
19
20
# File 'lib/bmf/lib/xmlrpc_client.rb', line 18

def method_missing meth, *args
  @client.call(meth.to_s, *args)
end

Class Method Details

.is_error?(response_string) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
25
# File 'lib/bmf/lib/xmlrpc_client.rb', line 22

def self.is_error? response_string
  return true if response_string =~ /^Invalid Method:/
  response_string =~ /^API Error /
end

Instance Method Details

#initialize_clientObject



14
15
16
# File 'lib/bmf/lib/xmlrpc_client.rb', line 14

def initialize_client
  @client = XMLRPC::Client.new2(Settings.instance.server_url)
end