class PaApi::POA

Provides a connection to the defualt POA API, as set in ENV

Public Class Methods

new(host: ENV['POA_API'], path: '/RPC2', port: 8440) click to toggle source
# File lib/pa_api.rb, line 10
def initialize(host: ENV['POA_API'], path: '/RPC2', port: 8440)
  @conn = XMLRPC::Client.new3(host: host, path: path, port: port)
end

Public Instance Methods

call(method, params = {}) click to toggle source

Makes a call to the POA API, with the method param being the full POA method name, as a string, and an optional params Hash. Returns a Hash result.

# File lib/pa_api.rb, line 17
def call(method, params = {})
  begin
    @conn.call(method, params)
  rescue => e
    return e
  end
end