Class: Symbol

Inherits:
Object
  • Object
show all
Defined in:
lib/core_ext/to_upnp_s.rb

Instance Method Summary collapse

Instance Method Details

#to_upnp_sString

Converts Symbol search targets to SSDP search target String. Conversions are as follows:

:all    # => "ssdp:all"
:root   # => "upnp:rootdevice"
"root"  # => "upnp:rootdevice"

Returns:

  • (String)

    The converted String, according to the UPnP spec.



47
48
49
50
51
52
53
54
55
# File 'lib/core_ext/to_upnp_s.rb', line 47

def to_upnp_s
  if self == :all
    'ssdp:all'
  elsif self == :root
    'upnp:rootdevice'
  else
    self
  end
end