Sha256: 204b52fdb4be6e50f25a77706c4cbcbe7c3a1fca078f22055617e013b3ca23aa

Contents?: true

Size: 476 Bytes

Versions: 1

Compression:

Stored size: 476 Bytes

Contents

# frozen_string_literal: true

class BCDD::Result::Context::Success < BCDD::Result::Context
  include ::BCDD::Result::Success::Methods

  def and_expose(type, keys, terminal: true)
    unless keys.is_a?(::Array) && !keys.empty? && keys.all?(::Symbol)
      raise ::ArgumentError, 'keys must be an Array of Symbols'
    end

    exposed_value = acc.merge(value).slice(*keys)

    self.class.new(type: type, value: exposed_value, subject: subject, terminal: terminal)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bcdd-result-0.11.0 lib/bcdd/result/context/success.rb