Class: ExperianMS::API

Inherits:
Object
  • Object
show all
Includes:
OAuth, HTTParty
Defined in:
lib/experian_ms/api.rb

Instance Attribute Summary

Attributes included from OAuth

#oauth_response

Instance Method Summary collapse

Methods included from OAuth

#authenticate, #grant_header

Constructor Details

#initialize(options = {}) ⇒ API

Creates a new API



12
13
14
15
16
17
18
# File 'lib/experian_ms/api.rb', line 12

def initialize(options={})
  options = ExperianMS.options.merge(options)
  Configuration::VALID_OPTIONS_KEYS.each do |key|
    send("#{key}=", options[key])
  end
  self.class.base_uri base_url
end

Instance Method Details

#change_base_uri=(uri) ⇒ Object



20
21
22
23
# File 'lib/experian_ms/api.rb', line 20

def change_base_uri=(uri)
  send(:base_url, uri)
  self.class.base_uri uri
end

#configObject



25
26
27
28
29
30
31
# File 'lib/experian_ms/api.rb', line 25

def config
  conf = {}
    Configuration::VALID_OPTIONS_KEYS.each do |key|
      conf[key] = send key
    end
  conf
end

#request(xml, end_point = '/ats/XmlPost/PostSecureAuth2/') ⇒ Object



33
34
35
36
# File 'lib/experian_ms/api.rb', line 33

def request(xml, end_point = '/ats/XmlPost/PostSecureAuth2/')
  authenticate
  post(xml, end_point)
end