Module: Flows::Result::Helpers
- Included in:
- Flows::Railway, Flows::Railway, SharedContextPipeline, SharedContextPipeline
- Defined in:
- lib/flows/result/helpers.rb
Overview
Shortcuts for building and matching result objects.
:reek:UtilityFunction
and :reek:FeatureEnvy
checks should be disabled here
because this module is intended to contain private utility methods only.
This module defines the following private methods:
ok(status = :ok, **data)
- for building successful results from a hash of keyword arguments.ok_data(data, status: :ok)
- for building successful results from any data.err(status = :err, **data)
- for building failure results from a hash of keyword arguments.err_data(data, status: :err)
- for building failure results from any data.match_ok(status = nil)
- for case matching against successful results.match_err(status = nil)
- for case matching against failure results.