Skip to content

Commit f9346ef

Browse files
simonx1alexrudall
authored andcommitted
Fix rubocop offences
1 parent f3f90d1 commit f9346ef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/openai/files.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
module OpenAI
22
class Files
3-
43
PURPOSES = %w[fine-tune assistants].freeze
54

65
def initialize(client:)
@@ -51,7 +50,9 @@ def prepare_file_input(file_input:)
5150

5251
def validate(file:, purpose:, file_input:)
5352
raise ArgumentError, "`file` is required" if file.nil?
54-
raise ArgumentError, "`purpose` must one of `#{PURPOSES.join(',')}`" unless PURPOSES.include?(purpose)
53+
unless PURPOSES.include?(purpose)
54+
raise ArgumentError, "`purpose` must one of `#{PURPOSES.join(',')}`"
55+
end
5556

5657
validate_jsonl(file: file) if file_input.is_a?(String) && file_input.end_with?(".jsonl")
5758
end

0 commit comments

Comments
 (0)