Skip to content

Instantly share code, notes, and snippets.

@ShopifyEng
Last active March 18, 2021 19:13
Show Gist options
  • Save ShopifyEng/a30c532e8e5120459f11dd25ee1aaed3 to your computer and use it in GitHub Desktop.
Save ShopifyEng/a30c532e8e5120459f11dd25ee1aaed3 to your computer and use it in GitHub Desktop.
Repository Pattern
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