From b9d7f32742f0080d47f07efdefad00023bffbc04 Mon Sep 17 00:00:00 2001 From: lindseytruong Date: Tue, 26 Nov 2024 11:34:41 -0500 Subject: [PATCH] update module check --- lib/lightspeed_restaurant/operations/create.rb | 2 +- lib/lightspeed_restaurant/operations/find.rb | 2 +- lib/lightspeed_restaurant/operations/list.rb | 2 +- spec/lightspeed_restaurant/external_payment_provider_spec.rb | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/lightspeed_restaurant/operations/create.rb b/lib/lightspeed_restaurant/operations/create.rb index 8b12aa1..2d4faad 100644 --- a/lib/lightspeed_restaurant/operations/create.rb +++ b/lib/lightspeed_restaurant/operations/create.rb @@ -16,7 +16,7 @@ def create(attributes, configuration = nil) def handle_create_response(response, attributes) if response == Numeric attributes.merge(id: response) - elsif LightspeedRestaurantClient::ExternalPaymentProvider + elsif self == LightspeedRestaurantClient::ExternalPaymentProvider attributes.merge(id: response['data'].first['id']) else response diff --git a/lib/lightspeed_restaurant/operations/find.rb b/lib/lightspeed_restaurant/operations/find.rb index 307e108..6e81de3 100644 --- a/lib/lightspeed_restaurant/operations/find.rb +++ b/lib/lightspeed_restaurant/operations/find.rb @@ -11,7 +11,7 @@ def find(id, configuration = nil) private def id_path(id) - return id.to_s if LightspeedRestaurantClient::ExternalPaymentProvider + return id.to_s if self == LightspeedRestaurantClient::ExternalPaymentProvider "/#{id}" end diff --git a/lib/lightspeed_restaurant/operations/list.rb b/lib/lightspeed_restaurant/operations/list.rb index 61ecf0e..5dc50ce 100644 --- a/lib/lightspeed_restaurant/operations/list.rb +++ b/lib/lightspeed_restaurant/operations/list.rb @@ -19,7 +19,7 @@ def resource_path def handle_list_response(response) case response when Hash - LightspeedRestaurantClient::ExternalPaymentProvider ? response['data'] : response['results'] + self == LightspeedRestaurantClient::ExternalPaymentProvider ? response['data'] : response['results'] else response end diff --git a/spec/lightspeed_restaurant/external_payment_provider_spec.rb b/spec/lightspeed_restaurant/external_payment_provider_spec.rb index 7743444..b05d09f 100644 --- a/spec/lightspeed_restaurant/external_payment_provider_spec.rb +++ b/spec/lightspeed_restaurant/external_payment_provider_spec.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'spec_helper' -require 'pry' module LightspeedRestaurantClient describe ExternalPaymentProvider do