Skip to content

Commit b5f0419

Browse files
chore: add @yieldparam to yard doc (#36)
1 parent cc08aa1 commit b5f0419

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/openai/pooled_net_requester.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def calibrate_socket_timeout(conn, deadline)
5151
#
5252
# @param blk [Proc]
5353
#
54+
# @yieldparam [String]
5455
# @return [Net::HTTPGenericRequest]
5556
def build_request(request, &)
5657
method, url, headers, body = request.fetch_values(:method, :url, :headers, :body)
@@ -86,6 +87,9 @@ def build_request(request, &)
8687
# @param url [URI::Generic]
8788
# @param deadline [Float]
8889
# @param blk [Proc]
90+
#
91+
# @raise [Timeout::Error]
92+
# @yieldparam [Net::HTTP]
8993
private def with_pool(url, deadline:, &blk)
9094
origin = OpenAI::Util.uri_origin(url)
9195
timeout = deadline - OpenAI::Util.monotonic_secs

lib/openai/util.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,8 @@ def read(max_len = nil, out_string = nil)
429429
#
430430
# @param stream [String, IO, StringIO, Enumerable]
431431
# @param blk [Proc]
432+
#
433+
# @yieldparam [String]
432434
def initialize(stream, &blk)
433435
@stream = stream.is_a?(String) ? StringIO.new(stream) : stream
434436
@buf = String.new.b
@@ -439,6 +441,7 @@ def initialize(stream, &blk)
439441
class << self
440442
# @param blk [Proc]
441443
#
444+
# @yieldparam [Enumerator::Yielder]
442445
# @return [Enumerable]
443446
def string_io(&blk)
444447
Enumerator.new do |y|
@@ -633,6 +636,7 @@ def close_fused!(enum)
633636
# @param enum [Enumerable, nil]
634637
# @param blk [Proc]
635638
#
639+
# @yieldparam [Enumerator::Yielder]
636640
# @return [Enumerable]
637641
def chain_fused(enum, &blk)
638642
iter = Enumerator.new { blk.call(_1) }

0 commit comments

Comments
 (0)