Created
June 2, 2022 00:17
-
-
Save vgarro/42ce27287099114a70d87dfc77627e1c to your computer and use it in GitHub Desktop.
Lizcov Substitution Coding challenge
This file contains 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
# Lizcov | |
class Payable | |
def pay(amount:, credit_card_details:) | |
payment_processor.charge!(amount: amount, credit_card_details: credit_card_details) | |
end | |
end | |
class Bill < Payable | |
def charge_credit_card(amount:, credit_card_details:) | |
pay(amount:, credit_card_details:) | |
end | |
def payment_processor | |
CreditCardPaymentProcessor | |
end | |
end | |
class Loan < Payable | |
def authorize_loan | |
# some Loan Authorization Logic | |
end | |
def payment_processor | |
LoanPaymentProcessor | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment