Class: Reggora::LenderApiClient

Inherits:
Object
  • Object
show all
Defined in:
lib/reggora.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(username, password, integration_token) ⇒ LenderApiClient

Returns a new instance of LenderApiClient.

Parameters:

  • username (String)
  • password (String)
  • integration_token (String)


15
16
17
18
# File 'lib/reggora.rb', line 15

def initialize(username, password, integration_token)
  authorization = ApiClient.authenticate(username, password, 'lender')
  @api_client = Requests.new(authorization["token"], integration_token, 'lender')
end

Class Method Details

.authenticate(username, password) ⇒ Object

Parameters:

  • username (string)
  • password (string)


22
23
24
# File 'lib/reggora.rb', line 22

def self.authenticate(username, password)
  ApiClient.authenticate(username, password, 'lender')
end

Instance Method Details

#delete(url, params = {}) ⇒ Object



42
43
44
# File 'lib/reggora.rb', line 42

def delete(url, params =  {})
  @api_client.delete(url, params)
end

#get(url, params = {}) ⇒ Object



26
27
28
# File 'lib/reggora.rb', line 26

def get(url, params = {})
  @api_client.get(url, params)
end

#post(url, params = {}, query_params = {}) ⇒ Object



30
31
32
# File 'lib/reggora.rb', line 30

def post(url, params = {}, query_params = {})
  @api_client.post(url, params, query_params)
end

#post_file(url, params = {}) ⇒ Object



34
35
36
# File 'lib/reggora.rb', line 34

def post_file(url, params = {})
  @api_client.post_file(url, params)
end

#put(url, params = {}) ⇒ Object



38
39
40
# File 'lib/reggora.rb', line 38

def put(url, params = {})
  @api_client.put(url, params)
end