class Minfraud::HTTPService::Request
Request
performs HTTP requests.
Attributes
middleware[R]
A proc containing Faraday configuration.
@return [Proc, nil]
server[R]
The API endpoint.
@return [String, nil]
Public Class Methods
new(params = {})
click to toggle source
@param params [Hash] Hash of parameters. Each key/value should
correspond to one of the available attributes.
# File lib/minfraud/http_service/request.rb, line 21 def initialize(params = {}) @middleware = params[:middleware] @server = params[:server] end
Public Instance Methods
perform(params)
click to toggle source
Perform an HTTP request to the specified endpoint with given body.
@param params [Hash] Hash of parameters, including :verb
,
+:endpoint+, and +:body+.
@return [Farday::Response]
# File lib/minfraud/http_service/request.rb, line 32 def perform(params) connection = Minfraud.connection connection.send(*params.values_at(:verb, :endpoint, :body)) end