lib/net/dns/rr/srv.rb in net-dns-0.9.0 vs lib/net/dns/rr/srv.rb in net-dns-0.20.0
- old
+ new
@@ -3,11 +3,14 @@
class RR
#------------------------------------------------------------
# RR type SRV
#------------------------------------------------------------
class SRV < RR
- attr_reader :priority, :weight, :port, :host
+ attr_reader :priority
+ attr_reader :weight
+ attr_reader :port
+ attr_reader :host
private
def build_pack
str = ""
@@ -18,10 +21,10 @@
@priority, @weight, @port = data.unpack("@#{offset} n n n")
offset += 6
@host = []
while offset < off_end
- len = data.unpack("@#{offset} C")[0]
+ len = data.unpack1("@#{offset} C")
offset += 1
str = data[offset..offset + len - 1]
offset += len
@host << str
end