class SSDP::SsdpHeader

Public Class Methods

new(http_header) click to toggle source
# File lib/ssdp.rb, line 14
def initialize(http_header)
  @http_header = http_header
end

Public Instance Methods

[](key) click to toggle source
# File lib/ssdp.rb, line 46
def [](key)
  @http_header[key]
end
[]=(key, value) click to toggle source
# File lib/ssdp.rb, line 50
def []=(key, value)
  @http_header[key] = value
end
http_response?() click to toggle source
# File lib/ssdp.rb, line 34
def http_response?
  @http_header.firstline[0].start_with? 'HTTP'
end
location() click to toggle source
# File lib/ssdp.rb, line 42
def location
  self['location']
end
msearch?() click to toggle source
# File lib/ssdp.rb, line 30
def msearch?
  @http_header.firstline[0] == 'M-SEARCH'
end
notify?() click to toggle source
# File lib/ssdp.rb, line 18
def notify?
  @http_header.firstline[0] == 'NOTIFY'
end
notify_alive?() click to toggle source
# File lib/ssdp.rb, line 22
def notify_alive?
  self.notify? and @http_header['nts'] == 'ssdp:alive'
end
notify_byebye?() click to toggle source
# File lib/ssdp.rb, line 26
def notify_byebye?
  self.notify? and @http_header['nts'] == 'ssdp:byebye'
end
to_s() click to toggle source
# File lib/ssdp.rb, line 54
def to_s
  @http_header.to_s
end
to_str() click to toggle source
# File lib/ssdp.rb, line 58
def to_str
  @http_header.to_str
end
usn() click to toggle source
# File lib/ssdp.rb, line 38
def usn
  self['usn']
end