Sha256: d2b109641fda7da8adb7828d21434d755d6d97a2763d1d9b3a151593878daaf1

Contents?: true

Size: 965 Bytes

Versions: 2

Compression:

Stored size: 965 Bytes

Contents

# frozen_string_literal: true

module Fluxo
  def self.config
    @config ||= Config.new
    yield(@config) if block_given?
    @config
  end

  class Config
    attr_reader :error_handlers

    # When set to true, the result of a falsey operation will be wrapped in a Failure.
    attr_accessor :wrap_falsey_result

    # When set to true, the result of a truthy operation will be wrapped in a Success.
    attr_accessor :wrap_truthy_result

    # When set to true, the operation will not validate the transient_attributes defition during the flow step execution.
    attr_accessor :strict_transient_attributes

    # When set to true, the operation will not validate attributes definition before calling the operation.
    attr_accessor :strict_attributes

    def initialize
      @error_handlers = []
      @wrap_falsey_result = false
      @wrap_truthy_result = false
      @strict_transient_attributes = true
      @strict_attributes = true
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fluxo-0.2.1 lib/fluxo/config.rb
fluxo-0.2.0 lib/fluxo/config.rb