class SealineInsurance::Operations::CancelOrder

Public Class Methods

new(config:, order_id:) click to toggle source
Calls superclass method SealineInsurance::Operations::Base::new
# File lib/sealine_insurance/operations/cancel_order.rb, line 6
def initialize(config:, order_id:)
  super(config: config)
  @order_id = order_id
end

Public Instance Methods

call() click to toggle source
# File lib/sealine_insurance/operations/cancel_order.rb, line 11
def call
  raw_response = request.delete("/order/#{@order_id}")
  @response = Responses::Order.new(raw_response)
end
fetch_status!() click to toggle source
# File lib/sealine_insurance/operations/cancel_order.rb, line 16
def fetch_status!
  raw_response = request.get("/order/#{@order_id}")
  @response = Responses::Order.new(raw_response)
end

Private Instance Methods

finished_status_list() click to toggle source
# File lib/sealine_insurance/operations/cancel_order.rb, line 23
def finished_status_list
  @finished_status_list ||= [
    'REPEAT_CANCELLATION', # Требуется повтор отмены
    'NOT_CANCELLED',       # Не отменен
    'CANCELLED',           # Отменен
  ]
end
success_status_list() click to toggle source
# File lib/sealine_insurance/operations/cancel_order.rb, line 31
def success_status_list
  @success_status_list ||= ['CANCELLED']
end