summaryrefslogtreecommitdiff
path: root/lib/ipaddr.rb
diff options
context:
space:
mode:
authorTaketo Takashima <[email protected]>2023-11-16 17:53:32 +0900
committergit <[email protected]>2024-10-18 15:00:37 +0000
commiteb8cf1d60e4436bfebf52fbf4342ee6e5e18ba05 ()
tree8ad188409375a4ff69c7acf54bc960287d1d6c44 /lib/ipaddr.rb
parent6b1268c7bf0816a250991593f1e504db428b6e30 (diff)
[ruby/ipaddr] Added to_json/as_json method
Updated to use cidr method when return address with prefix in #as_json https://.com/ruby/ipaddr/commit/cf8181d53e
-rw-r--r--lib/ipaddr.rb16
1 files changed, 16 insertions, 0 deletions
@@ -227,6 +227,22 @@ class IPAddr
return str
end
# Returns a string containing the IP address representation in
# cidr notation
def cidr