Skip to content

Conditional Organizer #219

@Gimbardo

Description

@Gimbardo

I created some time ago an extension for the Interactor Gem, called "Conditional Organizer"

https://github.com/Engim-eu/interactor-conditional_organizer

it's a super easy extension that allows to do stuff like this

class ExampleConditionalOrganizer
  include Interactor::ConditionalOrganizer

  def true_method
    true
  end

  def false_method
    false
  end

  organize [{ class: CalledInteractor, if: :true_method },
            { class: NotCalledInteractor, if: :false_method }]
end

The main benefit is to have some logic (that is usually in the interactor) in the organizer, to have a better view of what's going on directly from that

If you find it useful to include in the main gem, I could work to integrate it with a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions