Class: UpnpContentExplorer::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/upnp_content_explorer/item.rb

Instance Method Summary collapse

Constructor Details

#initialize(xml_node) ⇒ Item

Returns a new instance of Item.



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/upnp_content_explorer/item.rb', line 3

def initialize(xml_node)
  @xml_node = xml_node
  @props = {}

  %w{id parentID restricted}.each do |m|
    define_singleton_method(m) { extract_xpath("@#{m}") }
  end

  %w{title class date}.each do |m|
    define_singleton_method(m) { extract_xpath("#{m}") }
  end

   = {}
  %w{
    size duration bitrate sampleFrequency nrAudioChannels resolution
    protocolInfo
  }.each do |m|
    v = extract_xpath("res/@#{m}")
    [m.to_sym] = v
    define_singleton_method(m) { v }
  end

  [:url] = extract_xpath('res')
  define_singleton_method('url') { [:url] }
end

Instance Method Details

#metadataObject



29
30
31
# File 'lib/upnp_content_explorer/item.rb', line 29

def 
  {}.merge()
end