Class: Blacksheep::Decorators::ResultMatcher
Constant Summary
collapse
- Matcher =
-> {
success_case = Dry::Matcher::Case.new do |action_result, _|
if action_result.success?
action_result
else
Dry::Matcher::Undefined
end
end
failure_case = Dry::Matcher::Case.new do |action_result, patterns|
if !action_result.success! && (patterns.empty? || patterns.include?(action_result.status))
value
else
Dry::Matcher::Undefined
end
end
Dry::Matcher.new(success: success_case, failure: failure_case)
}.call
Instance Method Summary
collapse
#__class__, #class, #decorators_chain
Instance Method Details
#call ⇒ Object
33
34
35
|
# File 'lib/blacksheep/decorators/result_matcher.rb', line 33
def call(*)
super
end
|
37
38
39
|
# File 'lib/blacksheep/decorators/result_matcher.rb', line 37
def perform(*)
raise Blacksheep::Error, 'ResultMatcher does not support #perform'
end
|