lib/dns-sd/service_instance.rb in dns-sd-0.1.2 vs lib/dns-sd/service_instance.rb in dns-sd-0.1.3

- old
+ new

@@ -99,10 +99,11 @@ # method is called, the same set of records will be shuffled into the same # order. By default, each time this method is called, records are (probably) # returned in a different order. # # @return [Array<DNSSD::Target>] - def targets(deterministic: nil) + def targets(opts = {}) + deterministic = opts[:deterministic] [].tap do |list| left = cached_resources(@fqdn, Resolv::DNS::Resource::IN::SRV) seed = if deterministic left = left.sort_by { |rr| [rr.target.to_s, rr.port] }