module BetfairApiNgRails::Api::Helper

Public Instance Methods

prepare_api_req_json(method, params) click to toggle source
# File lib/betfair_api_ng_rails/api/helper.rb, line 18
def prepare_api_req_json(method, params)
  {
    "jsonrpc" => "2.0",
    "method" => "#{method.json_method}/v1.0/#{method.name}",
    "params" => params
  }.to_json
end
read_certificate_file(path) click to toggle source
# File lib/betfair_api_ng_rails/api/helper.rb, line 4
def read_certificate_file(path)
  OpenSSL::X509::Certificate.new read_file(path)
end
read_file(path) click to toggle source
# File lib/betfair_api_ng_rails/api/helper.rb, line 12
def read_file(path)
  File.read path
rescue
  ""
end
read_rsa_file(path) click to toggle source
# File lib/betfair_api_ng_rails/api/helper.rb, line 8
def read_rsa_file(path)
  OpenSSL::PKey::RSA.new read_file(path)
end