Class: UpnpContentExplorer::Explorer
- Inherits:
-
Object
- Object
- UpnpContentExplorer::Explorer
- Defined in:
- lib/upnp_content_explorer/explorer.rb
Instance Method Summary collapse
- #children_of(path) ⇒ Object
-
#initialize(service) ⇒ Explorer
constructor
A new instance of Explorer.
- #items_of(path) ⇒ Object
- #node_at(path) ⇒ Object
- #scrape(path) ⇒ Object
Constructor Details
Instance Method Details
#children_of(path) ⇒ Object
20 21 22 |
# File 'lib/upnp_content_explorer/explorer.rb', line 20 def children_of(path) node_at(path).children end |
#items_of(path) ⇒ Object
24 25 26 |
# File 'lib/upnp_content_explorer/explorer.rb', line 24 def items_of(path) node_at(path).items end |
#node_at(path) ⇒ Object
16 17 18 |
# File 'lib/upnp_content_explorer/explorer.rb', line 16 def node_at(path) find_terminal_node(prepare_path(path)) end |
#scrape(path) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/upnp_content_explorer/explorer.rb', line 28 def scrape(path) node = find_terminal_node(prepare_path(path)) child_items = node.children.map do |child| scrape("#{path}/#{child.title}") end all_items = [] all_items += node.items all_items += child_items.flatten end |