Skip to content

Commit

Permalink
update module check
Browse files Browse the repository at this point in the history
  • Loading branch information
lindseytruong committed Nov 26, 2024
1 parent bebfa1b commit b9d7f32
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/lightspeed_restaurant/operations/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/lightspeed_restaurant/operations/find.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/lightspeed_restaurant/operations/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true

require 'spec_helper'
require 'pry'

module LightspeedRestaurantClient
describe ExternalPaymentProvider do
Expand Down

0 comments on commit b9d7f32

Please sign in to comment.