Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 597 Bytes

UseCases.md

File metadata and controls

35 lines (25 loc) · 597 Bytes
Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 1 column 31
---
title: Clean Architecture Ruby: Use Cases
---

Use Cases

Standard Directory: use_case/

Libraries

Example

module AcmeIndustries
  module Widget
    module UseCase
      class WidgetsPerFooBarReport
        Deject self, :widget_gateway
        
        def execute(from_date:, to_date:) # receive a hash
           # widgets is a collection of Domain::Widget objects
           widgets = widget_gateway.all

           # secret sauce here
           
           {} # return a hash
        end
      end
    end
  end
end