Skip to content

Commit

Permalink
Add Socket::Address#pretty_print and #inspect (#6704)
Browse files Browse the repository at this point in the history
* Add Socket::IPAddress#pretty_print and #inspect

* fixup! Add Socket::IPAddress#pretty_print and #inspect
  • Loading branch information
straight-shoota authored and RX14 committed Sep 12, 2018
1 parent c6ee7bc commit ee71249
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/socket/address.cr
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@ class Socket
end
end

def inspect(io)
io << "Socket::IPAddress("
to_s(io)
io << ")"
end

def pretty_print(pp)
pp.text inspect
end

def to_unsafe : LibC::Sockaddr*
case family
when Family::INET6
Expand Down

0 comments on commit ee71249

Please sign in to comment.