项目作者: collectiveidea

项目描述 :
Interactor Rails provides Rails support for the Interactor gem.
高级语言: Ruby
项目地址: git://github.com/collectiveidea/interactor-rails.git
创建时间: 2013-08-17T04:14:51Z
项目社区:https://github.com/collectiveidea/interactor-rails

开源协议:MIT License

下载


Interactor Rails

Gem
Build
Coverage
Maintainability

Interactor Rails provides Rails support for the
Interactor gem.

Installation

Add this line to your application’s Gemfile:

  1. gem "interactor-rails", "~> 2.0"

Interactor Rails is tested against Ruby 3.1 and newer on Rails 7.0 or newer.
For older versions of Ruby and Rails use version 2.2.1.

Usage

Interactor Rails ensures that app/interactors is included in your autoload
paths, and provides generators for your convenience.

  1. rails generate interactor authenticate_user

adds to app/interactors/authenticate_user.rb:

  1. class AuthenticateUser
  2. include Interactor
  3. def call
  4. # TODO
  5. end
  6. end

There is also a generator for organizers.

  1. rails generate interactor:organizer place_order charge_card send_thank_you fulfill_order

adds to app/interactors/place_order.rb:

  1. class PlaceOrder
  2. include Interactor::Organizer
  3. organize ChargeCard, SendThankYou, FulfillOrder
  4. end

Contributions

Interactor Rails is open source and contributions from the community are
encouraged! No contribution is too small.

See Interactor Rails’
contribution guidelines for more information.

Thank You!

A very special thank you to Attila Domokos for
his fantastic work on LightService.
Interactor is inspired heavily by the concepts put to code by Attila.