Class: Shift4::Communicator
- Inherits:
-
Object
- Object
- Shift4::Communicator
- Defined in:
- lib/shift4/communicator.rb
Class Attribute Summary collapse
-
.web_consumer ⇒ Object
Returns the value of attribute web_consumer.
Class Method Summary collapse
- .delete(url, config: Configuration) ⇒ Object
- .get(url, query: nil, config: Configuration) ⇒ Object
- .post(url, json: nil, body: nil, config: Configuration) ⇒ Object
Class Attribute Details
.web_consumer ⇒ Object
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 |