Last active
March 18, 2021 19:13
-
-
Save ShopifyEng/a30c532e8e5120459f11dd25ee1aaed3 to your computer and use it in GitHub Desktop.
Repository Pattern
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
module PricingEngine | |
class PricingRepositoryInterface | |
def variants_by_ids(ids) | |
raise NotImplemented | |
end | |
def variants_by_titles(titles) | |
raise NotImplemented | |
end | |
end | |
module Schema | |
class Variant | |
attr_accessor :title | |
attr_accessor :price | |
def initialize(title:, price:) | |
@title = title | |
@price = price | |
end | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment