Skip to content

Commit 9ee2111

Browse files
committed
Make method public
1 parent c02665a commit 9ee2111

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/openai/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def self.to_json(string)
101101
#
102102
# @param user_proc [Proc] The proc to call for each JSON object in the chunk.
103103
# @return [Proc] A proc that can be used to iterate over the JSON stream.
104-
private_class_method def self.to_json_stream(user_proc:)
104+
def self.to_json_stream(user_proc:)
105105
proc do |chunk, _|
106106
chunk.scan(/(?:data|error): (\{.*\})/i).flatten.each do |data|
107107
user_proc.call(JSON.parse(data))

spec/openai/client/client_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
describe ".to_json_stream" do
2929
context "with a proc" do
3030
let(:user_proc) { proc { |x| x } }
31-
let(:stream) { OpenAI::Client.send(:to_json_stream, user_proc: user_proc) }
31+
let(:stream) { OpenAI::Client.to_json_stream(user_proc: user_proc) }
3232

3333
it "returns a proc" do
3434
expect(stream).to be_a(Proc)

0 commit comments

Comments
 (0)