Skip to content

Commit 7b859a9

Browse files
committed
Refactor code: use yield
Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
1 parent 079c5c5 commit 7b859a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/fluent/plugin/in_otlp.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def traces(req, &block)
113113

114114
private
115115

116-
def common(req, request_class, response_class, &block)
116+
def common(req, request_class, response_class)
117117
content_type = req.headers["content-type"]
118118
content_encoding = req.headers["content-encoding"]&.first
119119
return response_unsupported_media_type unless valid_content_type?(content_type)
@@ -129,7 +129,7 @@ def common(req, request_class, response_class, &block)
129129
return response_bad_request(content_type)
130130
end
131131

132-
block.call(record)
132+
yield record
133133

134134
res = response_class.new
135135
response(200, content_type, res.body(type: Otlp::Response.type(content_type)))

0 commit comments

Comments
 (0)