Skip to content

Conventions around specifying schema? #5

@mtvillwock

Description

@mtvillwock

Note: This may fall under the purview of #2

I was wondering if there is an established convention regarding specifying which attributes in the schema are required for the initial Organizer invocation versus those that are added to the schema later while the organized Interactors are running.

E.g.,

class SomeOrganizer
  include Interactor
  include Interactor::Schema

  schema 
    :initial_value,
    :_new_value_from_operation,
    :_different_value_we_need_later,
    :_end_result
  
  organize(FirstEvent, SecondEvent, ThirdEvent, Finish)
end
class SecondEvent
include Interactor

  def call
    context.new_value_from_operation = calculate_new_value
  end
end

The _attribute_name approach is just an example approach.

Do you have ideas around conventions for indicating which schema attributes are for SomeOrganizer.call(initial_value: some_value) vs one being added later on, e.g., SecondEvent.call(context) adding new_value_from_operation to the context?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions