Sha256: 8d866bccb469e844ee977b78487c58822f1183b163abc255d20e9c561b3a005c

Contents?: true

Size: 1.35 KB

Versions: 1

Compression:

Stored size: 1.35 KB

Contents

module ShoppingCart
  class Database
    attr_reader :uri

    def initialize(uri)
      @uri = uri
    end
  end

  class UserService
    attr_reader :db

    def initialize(db)
      @db = db
    end
  end

  class ProductService
    attr_reader :db

    def initialize(db)
      @db = db
    end
  end

  class ShoppingCartService
    attr_reader :db, :product_service, :user_service

    def initialize(db, product_service, user_service)
      @db = db
      @product_service = product_service
      @user_service = user_service
    end
  end

  class UserController
    attr_reader :user_service

    def initialize(user_service)
      @user_service = user_service
    end
  end

  class ProductController
    attr_reader :product_service

    def initialize(product_service)
      @product_service = product_service
    end
  end

  class ShoppingCartController
    attr_reader :shopping_cart_service

    def initialize(shopping_cart_service)
      @shopping_cart_service = shopping_cart_service
    end
  end

  class Application
    attr_reader :user_controller, :product_controller, :shopping_cart_controller

    def initialize(user_controller, product_controller,
                   shopping_cart_controller)
      @user_controller = user_controller
      @product_controller = product_controller
      @shopping_cart_controller = shopping_cart_controller
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jerry-2.0.1 spec/fixtures/shopping_cart.rb