Class: TrueTrial::Resources::Temporal
- Inherits:
-
Object
- Object
- TrueTrial::Resources::Temporal
- Defined in:
- lib/truetrial/resources/temporal.rb
Overview
Provides access to temporal element API endpoints (trials, warranties, etc.).
Instance Method Summary collapse
-
#adjust(order_id, data) ⇒ Hash
Adjusts a temporal element (modify start/end dates).
-
#claim(order_id, data) ⇒ Hash
Initiates a warranty or guarantee claim.
-
#extend(order_id, data) ⇒ Hash
Extends a temporal element duration.
-
#get(order_id) ⇒ Hash
Retrieves the temporal element for an order.
-
#initialize(http_client) ⇒ Temporal
constructor
A new instance of Temporal.
-
#resolve_claim(order_id, data) ⇒ Hash
Resolves a warranty or guarantee claim.
Constructor Details
#initialize(http_client) ⇒ Temporal
Returns a new instance of Temporal.
7 8 9 |
# File 'lib/truetrial/resources/temporal.rb', line 7 def initialize(http_client) @http = http_client end |
Instance Method Details
#adjust(order_id, data) ⇒ Hash
Adjusts a temporal element (modify start/end dates).
33 34 35 |
# File 'lib/truetrial/resources/temporal.rb', line 33 def adjust(order_id, data) @http.post("/orders/#{order_id}/temporal/adjust", body: data) end |
#claim(order_id, data) ⇒ Hash
Initiates a warranty or guarantee claim.
42 43 44 |
# File 'lib/truetrial/resources/temporal.rb', line 42 def claim(order_id, data) @http.post("/orders/#{order_id}/temporal/claim", body: data) end |
#extend(order_id, data) ⇒ Hash
Extends a temporal element duration.
24 25 26 |
# File 'lib/truetrial/resources/temporal.rb', line 24 def extend(order_id, data) @http.post("/orders/#{order_id}/temporal/extend", body: data) end |
#get(order_id) ⇒ Hash
Retrieves the temporal element for an order.
15 16 17 |
# File 'lib/truetrial/resources/temporal.rb', line 15 def get(order_id) @http.get("/orders/#{order_id}/temporal") end |
#resolve_claim(order_id, data) ⇒ Hash
Resolves a warranty or guarantee claim.
51 52 53 |
# File 'lib/truetrial/resources/temporal.rb', line 51 def resolve_claim(order_id, data) @http.post("/orders/#{order_id}/temporal/resolve-claim", body: data) end |