Module: Trailblazer::Endpoint::Protocol::Bridge

Defined in:
lib/trailblazer/endpoint/protocol.rb

Constant Summary collapse

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)

Class.new(Trailblazer::Activity::Signal)
NotAuthorized =
Class.new(Trailblazer::Activity::Signal)
NotAuthenticated =
Class.new(Trailblazer::Activity::Signal)

Class Method Summary collapse

Class Method Details

.insert(protocol) ⇒ Object



74
75
76
77
78
79
80
81
82
83
84
# File 'lib/trailblazer/endpoint/protocol.rb', line 74

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