Class: TrueTrial::Resources::Cancellations
- Inherits:
-
Object
- Object
- TrueTrial::Resources::Cancellations
- Defined in:
- lib/truetrial/resources/cancellations.rb
Overview
Provides access to cancellation-related API endpoints.
Instance Method Summary collapse
-
#create(order_id, data) ⇒ Hash
Creates a cancellation for an order.
-
#get(order_id) ⇒ Hash
Retrieves the cancellation for an order.
-
#initialize(http_client) ⇒ Cancellations
constructor
A new instance of Cancellations.
Constructor Details
#initialize(http_client) ⇒ Cancellations
Returns a new instance of Cancellations.
7 8 9 |
# File 'lib/truetrial/resources/cancellations.rb', line 7 def initialize(http_client) @http = http_client end |
Instance Method Details
#create(order_id, data) ⇒ Hash
Creates a cancellation for an order.
16 17 18 |
# File 'lib/truetrial/resources/cancellations.rb', line 16 def create(order_id, data) @http.post("/orders/#{order_id}/cancellations", body: data) end |
#get(order_id) ⇒ Hash
Retrieves the cancellation for an order.
24 25 26 |
# File 'lib/truetrial/resources/cancellations.rb', line 24 def get(order_id) @http.get("/orders/#{order_id}/cancellations") end |