lib/bcdd/result/context/success.rb in bcdd-result-0.9.0 vs lib/bcdd/result/context/success.rb in bcdd-result-0.9.1
- old
+ new
@@ -1,15 +1,15 @@
# frozen_string_literal: true
class BCDD::Result::Context::Success < BCDD::Result::Context
include ::BCDD::Result::Success::Methods
- def and_expose(type, keys)
+ def and_expose(type, keys, halted: 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)
+ self.class.new(type: type, value: exposed_value, subject: subject, halted: halted)
end
end