Class: Shift4::Communicator

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

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.web_consumerObject

Returns the value of attribute web_consumer.



8
9
10
# File 'lib/shift4/communicator.rb', line 8

def web_consumer
  @web_consumer
end

Class Method Details

.delete(url, config: Configuration) ⇒ Object



25
26
27
28
29
# File 'lib/shift4/communicator.rb', line 25

def self.delete(url, config: Configuration)
  response = web_consumer.delete(url, request(config: config))
  handle_response(response)
  response
end

.get(url, query: nil, config: Configuration) ⇒ Object



13
14
15
16
17
# File 'lib/shift4/communicator.rb', line 13

def self.get(url, query: nil, config: Configuration)
  response = web_consumer.get(url, request(query: query, config: config))
  handle_response(response)
  response
end

.post(url, json: nil, body: nil, config: Configuration) ⇒ Object



19
20
21
22
23
# File 'lib/shift4/communicator.rb', line 19

def self.post(url, json: nil, body: nil, config: Configuration)
  response = web_consumer.post(url, request(json: json, body: body, config: config))
  handle_response(response)
  response
end