Created
December 24, 2017 18:44
-
-
Save cored/834a78c2f11af8761f21118380c29dd3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module EasyPost | |
module Carriers | |
class CancelSlot | |
attr_reader :ez_shipment | |
def self.call(courier_slot) | |
new.call(courier_slot) | |
end | |
def initialize(easy_post_api: EasyPost::Shipment) | |
@easy_post_api = easy_post_api | |
end | |
def call(external_api_identifier) | |
@ez_shipment = easy_post_api.retrieve(external_api_identifier) | |
ez_shipment.refund | |
self | |
end | |
private | |
attr_reader :easy_post_api | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment