Holds information about an M-SEARCH
Creates a new Search
# File lib/UPnP/SSDP.rb, line 300 def initialize(date, target, wait_time) @date = date @target = target @wait_time = wait_time end
Creates a new Search by parsing the text in
response
# File lib/UPnP/SSDP.rb, line 287 def self.parse(response) response =~ %r^mx:\s*(\d+)/ wait_time = Integer $1 response =~ %r^st:\s*(\S*)/ target = $1.strip new Time.now, target, wait_time end
Expiration time of this advertisement
# File lib/UPnP/SSDP.rb, line 309 def expiration date + wait_time end
A friendlier inspect
# File lib/UPnP/SSDP.rb, line 316 def inspect "#<#{self.class}:0x#{object_id.to_s 16} #{target}>" end