Skip to content

Commit

Permalink
Simplify result method
Browse files Browse the repository at this point in the history
still ugly tho
  • Loading branch information
davishmcclurg committed Oct 13, 2023
1 parent 16fe776 commit 795a9b3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/json_schemer/output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ module Output
private

def result(instance, instance_location, keyword_location, valid, nested = nil, type: nil, annotation: nil, details: nil, ignore_nested: false)
if valid
Result.new(self, instance, instance_location, keyword_location, valid, nested, type, annotation, details, ignore_nested, 'annotations')
else
Result.new(self, instance, instance_location, keyword_location, valid, nested, type, annotation, details, ignore_nested, 'errors')
end
Result.new(self, instance, instance_location, keyword_location, valid, nested, type, annotation, details, ignore_nested, valid ? 'annotations' : 'errors')
end

def escaped_keyword
Expand Down

0 comments on commit 795a9b3

Please sign in to comment.