Sha256: 502b205c12c7619cd45d8d66f5c3a258d3ea0e9aec55db7262088330f5fee91e

Contents?: true

Size: 790 Bytes

Versions: 2

Compression:

Stored size: 790 Bytes

Contents

# frozen_string_literal: true

class BCDD::Context
  module Expectations::Mixin
    Factory = BCDD::Result::Expectations::Mixin::Factory

    Methods = BCDD::Result::Expectations::Mixin::Methods

    module Addons
      module Continue
        private def Continue(**value)
          Success(::BCDD::Result::IgnoredTypes::CONTINUE, **value)
        end
      end

      module Given
        private def Given(*values)
          value = values.map(&:to_h).reduce({}) { |acc, val| acc.merge(val) }

          Success(::BCDD::Result::IgnoredTypes::GIVEN, **value)
        end
      end

      OPTIONS = { continue: Continue, given: Given }.freeze

      def self.options(config_flags)
        ::BCDD::Result::Config::Options.addon(map: config_flags, from: OPTIONS)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bcdd-result-1.1.0 lib/bcdd/context/expectations/mixin.rb
bcdd-result-1.0.0 lib/bcdd/context/expectations/mixin.rb