Class: PaymentRails::Client

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

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Client

Returns a new instance of Client.



10
11
12
# File 'lib/paymentrails/Client.rb', line 10

def initialize(config)
  @config = config
end

Instance Method Details

#delete(endPoint) ⇒ Object



23
24
25
# File 'lib/paymentrails/Client.rb', line 23

def delete(endPoint)
  send_request(endPoint, 'DELETE')
end

#get(endPoint) ⇒ Object



14
15
16
# File 'lib/paymentrails/Client.rb', line 14

def get(endPoint)
  send_request(endPoint, 'GET')
end

#patch(endPoint, body) ⇒ Object



27
28
29
30
# File 'lib/paymentrails/Client.rb', line 27

def patch(endPoint, body)
  body = body.to_json
  send_request(endPoint, 'PATCH', body)
end

#post(endPoint, body) ⇒ Object



18
19
20
21
# File 'lib/paymentrails/Client.rb', line 18

def post(endPoint, body)
  body = body.to_json
  send_request(endPoint, 'POST', body)
end