mlomnicki/ddd-ecommerce

View on GitHub
lib/sales/adapter/persistence/product_repository.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Sales
  module Adapter
    module Persistence
      class ProductRepository
        def initialize(products = [])
          @products = products
        end

        def load(product_id)
          @products.find { |product| product.id == product_id }
        end
      end
    end
  end
end