Class: SterlingApi::Api
- Inherits:
-
Object
- Object
- SterlingApi::Api
- Defined in:
- lib/sterling_api.rb
Instance Method Summary collapse
-
#initialize(mode) ⇒ Api
constructor
mode: prod or test.
- #mode ⇒ Object
- #order(background_check) ⇒ Object
- #password_change_request(password_change) ⇒ Object
- #url(type) ⇒ Object
Constructor Details
Instance Method Details
#mode ⇒ Object
97 98 99 |
# File 'lib/sterling_api.rb', line 97 def mode @mode.to_s =~ /prod/i ? :prod : :test end |
#order(background_check) ⇒ Object
101 102 103 104 105 106 107 |
# File 'lib/sterling_api.rb', line 101 def order(background_check) req = SterlingApi::RemoteActions::Request.new( :url => url(:order_one_step), :body => background_check.to_xml ) req.send_request end |
#password_change_request(password_change) ⇒ Object
109 110 111 112 113 114 115 |
# File 'lib/sterling_api.rb', line 109 def password_change_request(password_change) req = SterlingApi::RemoteActions::Request.new( :url => url(:password_change), :body => password_change.to_xml ) req.send_request end |
#url(type) ⇒ Object
117 118 119 |
# File 'lib/sterling_api.rb', line 117 def url(type) SterlingApi::URLS[mode][type][:url] end |