{"id":22138362,"url":"https://github.com/takeruun/rails-domain","last_synced_at":"2026-04-24T12:03:14.938Z","repository":{"id":98237062,"uuid":"555686420","full_name":"takeruun/rails-domain","owner":"takeruun","description":"Domain-driven development with useacase implemented in rails","archived":false,"fork":false,"pushed_at":"2022-10-23T07:43:56.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-24T10:49:51.049Z","etag":null,"topics":["interactor","rails","usecase"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/takeruun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-22T04:45:34.000Z","updated_at":"2022-12-03T08:04:19.000Z","dependencies_parsed_at":"2023-03-07T07:30:33.671Z","dependency_job_id":null,"html_url":"https://github.com/takeruun/rails-domain","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/takeruun/rails-domain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takeruun%2Frails-domain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takeruun%2Frails-domain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takeruun%2Frails-domain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takeruun%2Frails-domain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takeruun","download_url":"https://codeload.github.com/takeruun/rails-domain/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takeruun%2Frails-domain/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32222483,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T10:26:35.452Z","status":"ssl_error","status_checked_at":"2026-04-24T10:25:27.643Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["interactor","rails","usecase"],"created_at":"2024-12-01T20:09:32.365Z","updated_at":"2026-04-24T12:03:14.904Z","avatar_url":"https://github.com/takeruun.png","language":"Ruby","readme":"# About\nUsecase/Interactor を利用した Rails-DDD Todo アプリケーション\n\n## Interactorオブジェクト\nInteractorオブジェクトとは「**デザインパターンのひとつで、ビジネスロジックをカプセル化するためのモデル層に属するクラス群**」。\n\nひとつのInteractorオブジェクトはひとつの責務をもつ。\n\n※「ひとつの責務」とは、たとえば「記事を投稿する」「決済を行う」という、それ以上分割できない責務。\n\n下記は、「ユーザーを見つける」Interactor です。\n```ruby\nmodule UserDomain\n  module Usecases\n    module Interactors\n      class FindUserInteractor \u003c ApplicationInteractor\n        delegate :params, to: :context, private: true\n\n        def call\n          user = Models::User.find_by(email: params[:email])\n          \n          if user.nil?\n            context.fail!(message: 'ユーザーが見つかりません。')\n          else\n            context[:user] = user\n          end\n        end\n\n      end\n    end\n  end\nend\n```\n\n## Usecaseオブジェクト\nUsecaseオブジェクトとは複数のInteractorを構成するクラスです。\n\n「ユーザーを見つける」「パスワードを検証する」「セッションに保存する」の Interactor の使用を定義します。\n```ruby\nmodule UserDomain\n  module Usecases\n    class SignIn \u003c ApplicationUsecase\n      include InteractorTransactional\n\n      organize Interactors::FindUserInteractor,\n                Interactors::PasswordVerificationInteractor,\n                Interactors::UpdateSessionInteractor\n    end\n  end\nend\n```\n\n\n**参考サイト**\n- https://applis.io/posts/rails-design-pattern-interactor-objects","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakeruun%2Frails-domain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakeruun%2Frails-domain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakeruun%2Frails-domain/lists"}