Class: Eloan::Client

Inherits:
Object
  • Object
show all
Includes:
Api
Defined in:
lib/eloan/client.rb

Instance Attribute Summary collapse

Attributes included from Helper::Service

#chaxue

Instance Method Summary collapse

Methods included from Api

#pay, #verify

Methods included from Helper::Request

#request_params

Methods included from Helper::Payment

#generate_default_params

Methods included from Helper::Signature

#handle_request_data, #handle_response_data, #hexdigest, #verify?

Methods included from Helper::Service

#generate_request_url, #handle_params, #raw_response

Constructor Details

#initialize(config) ⇒ Client

Returns a new instance of Client.



9
10
11
# File 'lib/eloan/client.rb', line 9

def initialize(config)
  @configurate = config
end

Instance Attribute Details

#configurateObject

Returns the value of attribute configurate.



7
8
9
# File 'lib/eloan/client.rb', line 7

def configurate
  @configurate
end

Instance Method Details

#execute(method, url, options) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/eloan/client.rb', line 13

def execute(method, url, options)
  if method == 'GET'
    response = RestClient.get(URI.escape(url), params: options) 
  else
    response = RestClient.post(URI.escape(url), options) 
  end
  raw_response response
end