class UpnpContentExplorer::Node

Constants

ROOT_ID

Public Class Methods

new(data) click to toggle source
# File lib/upnp_content_explorer/node.rb, line 5
def initialize(data)
  @data = data
end

Public Instance Methods

child(key) click to toggle source
# File lib/upnp_content_explorer/node.rb, line 38
def child(key)
  @data[:children][key]
end
children() click to toggle source
# File lib/upnp_content_explorer/node.rb, line 30
def children
  @data[:children].values || []
end
item(key) click to toggle source
# File lib/upnp_content_explorer/node.rb, line 42
def item(key)
  @data[:items][key]
end
items() click to toggle source
# File lib/upnp_content_explorer/node.rb, line 34
def items
  @data[:items].values || []
end
load!(data, mark_loaded = true) click to toggle source
# File lib/upnp_content_explorer/node.rb, line 19
def load!(data, mark_loaded = true)
  merged_data = @data.merge(data)
  merged_data[:loaded?] ||= mark_loaded

  @data = merged_data
end
loaded?() click to toggle source
# File lib/upnp_content_explorer/node.rb, line 9
def loaded?
  return false if @data[:loaded?].nil?
  @data[:loaded?]
end
method_missing(key) click to toggle source
Calls superclass method
# File lib/upnp_content_explorer/node.rb, line 14
def method_missing(key)
  return @data[key] if @data.has_key?(key)
  super
end
parent_id() click to toggle source
# File lib/upnp_content_explorer/node.rb, line 26
def parent_id
  @data[:parentID] || nil
end