Skip to content

Commit 32765fb

Browse files
committed
RBS
1 parent 2c590da commit 32765fb

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

sig/net-http.rbs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
# TCPSocket.open is an alias for TCPSocket.new in Ruby,
2+
# but RBS inherits IO.open which has a different signature.
3+
class TCPSocket
4+
def self.open: (String remote_host, Integer remote_port, ?String? local_host, ?Integer? local_port, ?open_timeout: Numeric?) -> TCPSocket
5+
| (String remote_host, Integer remote_port, ?String? local_host, ?Integer? local_port) -> TCPSocket
6+
end
7+
18
module Net
29
# Stubs for net-protocol classes
310
class Protocol
11+
def self.new: (*untyped) -> instance
412
end
513

614
class ProtocolError < StandardError
@@ -323,8 +331,7 @@ module Net
323331
def initialize: (String address, ?Integer? port) -> void
324332
def started?: () -> bool
325333
alias active? started?
326-
def start: () -> Net::HTTP
327-
| () { (Net::HTTP http) -> untyped } -> untyped
334+
def start: () ?{ (Net::HTTP http) -> untyped } -> (Net::HTTP | untyped)
328335
def finish: () -> void
329336

330337
def use_ssl?: () -> bool

0 commit comments

Comments
 (0)