rockaBe / interactor-rails

Interactor Rails provides Rails support for the Interactor gem.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Interactor Rails

Gem Version Build Status Code Climate Coverage Status Dependency Status

Interactor Rails provides Rails support for the Interactor gem.

Installation

Add this line to your application's Gemfile:

gem "interactor-rails", "~> 1.0"

Interactor Rails is compatible with Ruby 1.9 or 2.0 on Rails 3 or 4.

Usage

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

rails generate interactor authenticate_user

adds to app/interactors/authenticate_user.rb:

class AuthenticateUser
  include Interactor

  def perform
    # TODO
  end
end

There is also a generator for organizers.

rails generate interactor:organizer place_order charge_card send_thank_you fulfill_order

adds to app/interactors/place_order.rb:

class PlaceOrder
  include Interactor::Organizer

  organize ChargeCard, SendThankYou, FulfillOrder
end

Contributing

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

  • adding an awesome feature
  • fixing a terrible bug
  • updating documentation
  • fixing a not-so-bad bug
  • fixing typos

For the best chance of having your changes merged, please:

  1. Ask us! We'd love to hear what you're up to.
  2. Fork the project.
  3. Commit your changes and tests (if applicable (they're applicable)).
  4. Submit a pull request with a thorough explanation and at least one animated GIF.

Thanks

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.

About

Interactor Rails provides Rails support for the Interactor gem.

License:MIT License


Languages

Language:Ruby 100.0%