Skip to content

Commit 795a9b3

Browse files
committed
Simplify result method
still ugly tho
1 parent 16fe776 commit 795a9b3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/json_schemer/output.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ module Output
88
private
99

1010
def result(instance, instance_location, keyword_location, valid, nested = nil, type: nil, annotation: nil, details: nil, ignore_nested: false)
11-
if valid
12-
Result.new(self, instance, instance_location, keyword_location, valid, nested, type, annotation, details, ignore_nested, 'annotations')
13-
else
14-
Result.new(self, instance, instance_location, keyword_location, valid, nested, type, annotation, details, ignore_nested, 'errors')
15-
end
11+
Result.new(self, instance, instance_location, keyword_location, valid, nested, type, annotation, details, ignore_nested, valid ? 'annotations' : 'errors')
1612
end
1713

1814
def escaped_keyword

0 commit comments

Comments
 (0)