module Trailblazer::Endpoint::Protocol::Bridge

Constants

NotAuthenticated
NotAuthorized
NotFound

this “bridge” should be optional for “legacy operations” that don't have explicit ends. we have to inspect the ctx to find out what “really” happened (e.g. model empty ==> 404)

Public Class Methods

insert(protocol, **) click to toggle source
# File lib/trailblazer/endpoint/protocol.rb, line 81
def self.insert(protocol, **)
  Class.new(protocol) do
    fail :success?, after: :domain_activity,
    # FIXME: how to add more signals/outcomes?
    Output(NotFound, :not_found)            => Track(:not_found),

    # FIXME: Track(:not_authorized) is defined before this step, so the Forward search doesn't find it.
    # solution would be to walk down sequence and find the first {:magnetic_to} "not_authorized"
    Output(NotAuthorized, :not_authorized)  => Track(:not_authorized) # FIXME: how to "insert into path"? => Track(:not_authorized) doesn't play!
  end
end