method

foreach

Importance_1
Ruby latest stable (v2_5_5) - 0 notes - Class: Addrinfo
foreach(nodename, service, family=nil, socktype=nil, protocol=nil, flags=nil, &block) public

iterates over the list of Addrinfo objects obtained by Addrinfo.getaddrinfo.

Addrinfo.foreach(nil, 80) {|x| p x }
#=> #<Addrinfo: 127.0.0.1:80 TCP (:80)>
#   #<Addrinfo: 127.0.0.1:80 UDP (:80)>
#   #<Addrinfo: [::1]:80 TCP (:80)>
#   #<Addrinfo: [::1]:80 UDP (:80)>
Show source
Register or log in to add new notes.