Class: Socket

Inherits:
Object
  • Object
show all
Defined in:
lib/tcr.rb

Class Method Summary collapse

Class Method Details

.real_tcpObject



91
# File 'lib/tcr.rb', line 91

alias_method :real_tcp, :tcp

.tcp(host, port, local_host = nil, local_port = nil, **socket_opts) ⇒ Object



93
94
95
96
97
98
99
# File 'lib/tcr.rb', line 93

def tcp(host, port, local_host = nil, local_port = nil, **socket_opts)
  if TCR.configuration.hook_tcp_ports.include?(port)
    TCR::RecordableTCPSocket.new(host, port, TCR.cassette)
  else
    real_tcp(host, port, local_host, local_port, **socket_opts)
  end
end