Skip to content

Commit ff7f9d5

Browse files
committed
Clean up types.
1 parent bfe3eb1 commit ff7f9d5

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

design.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ module Protocol
140140

141141
# Parse service and method from gRPC path
142142
# @parameter path [String] e.g., "/my_service.Greeter/SayHello"
143-
# @returns [Array(String, String)] [service, method]
143+
# @returns [Tuple(String, String)] of service and method.
144144
def self.parse_path(path)
145145
parts = path.split("/")
146146
[parts[1], parts[2]]
@@ -287,7 +287,7 @@ module Protocol
287287

288288
# Extract gRPC status message from headers
289289
# @parameter headers [Protocol::HTTP::Headers]
290-
# @returns [String, nil] Status message
290+
# @returns [String | Nil] Status message
291291
def self.extract_message(headers)
292292
message = headers["grpc-message"]
293293
message ? URI.decode_www_form_component(message) : nil
@@ -329,7 +329,7 @@ module Protocol
329329
# @parameter body [Protocol::HTTP::Body::Readable] The underlying HTTP body
330330
# @parameter message_class [Class, nil] Protobuf message class with .decode method
331331
# If nil, returns raw binary data (useful for channel adapters)
332-
# @parameter encoding [String, nil] Compression encoding (from grpc-encoding header)
332+
# @parameter encoding [String | Nil] Compression encoding (from grpc-encoding header)
333333
def initialize(body, message_class: nil, encoding: nil)
334334
super(body)
335335
@message_class = message_class
@@ -408,7 +408,7 @@ module Protocol
408408
# Writes length-prefixed gRPC messages
409409
# This is the standard writable body for gRPC - all gRPC requests use message framing
410410
class Writable < Protocol::HTTP::Body::Writable
411-
# @parameter encoding [String, nil] Compression encoding (gzip, deflate, identity)
411+
# @parameter encoding [String | Nil] Compression encoding (gzip, deflate, identity)
412412
# @parameter level [Integer] Compression level if encoding is used
413413
def initialize(encoding: nil, level: Zlib::DEFAULT_COMPRESSION, **options)
414414
super(**options)
@@ -574,7 +574,7 @@ module Protocol
574574
end
575575

576576
# Get peer information (client address)
577-
# @returns [String, nil]
577+
# @returns [String | Nil]
578578
def peer
579579
@request.peer&.to_s
580580
end

lib/protocol/grpc/header/status.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def self.parse(value)
1818

1919
# Initialize the status header with the given value.
2020
#
21-
# @parameter value [String, Integer] The status code as a string or integer.
21+
# @parameter value [String | Integer] The status code as a string or integer.
2222
def initialize(value)
2323
@value = value.to_i
2424
end
@@ -38,7 +38,7 @@ def to_s
3838
end
3939

4040
# Merge another status value (takes the new value, as status should only appear once)
41-
# @parameter value [String, Integer] The new status code
41+
# @parameter value [String | Integer] The new status code
4242
def <<(value)
4343
@value = value.to_i
4444

lib/protocol/grpc/interface.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ module GRPC
1010
# Wrapper class to mark a message type as streamed.
1111
# Used with the stream() helper method in RPC definitions.
1212
class Streaming
13+
# Initialize a new Streaming wrapper.
14+
# @parameter message_class [Class] The message class being wrapped
1315
def initialize(message_class)
1416
@message_class = message_class
1517
end
@@ -148,7 +150,7 @@ def initialize(name)
148150
attr :name
149151

150152
# Build gRPC path for a method.
151-
# @parameter method_name [String, Symbol] Method name in PascalCase (e.g., :SayHello)
153+
# @parameter method_name [String | Symbol] Method name in PascalCase (e.g., :SayHello)
152154
# @returns [String] gRPC path with PascalCase method name
153155
def path(method_name)
154156
Methods.build_path(@name, method_name.to_s)

lib/protocol/grpc/methods.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def self.build_path(service, method)
2020

2121
# Parse service and method from gRPC path.
2222
# @parameter path [String] e.g., "/my_service.Greeter/SayHello"
23-
# @returns [Array(String, String)] [service, method]
23+
# @returns [Array(String | String)] [service, method]
2424
def self.parse_path(path)
2525
parts = path.split("/")
2626
[parts[1], parts[2]]

0 commit comments

Comments
 (0)