Module: TivoHMO::API::Container

Overview

Represents the tivo concept of a Container (i.e. a directory that contains files or other containers)

Instance Attribute Summary collapse

Attributes included from Node

#app, #children, #content_type, #created_at, #identifier, #modified_at, #parent, #root, #source_format, #title

Instance Method Summary collapse

Methods included from Node

#add_child, #app?, #find, #root?, #title_path, #to_s, #tree_string

Instance Attribute Details

#presortedObject

Returns the value of attribute presorted.



14
15
16
# File 'lib/tivohmo/api/container.rb', line 14

def presorted
  @presorted
end

#uuidObject

Returns the value of attribute uuid.



14
15
16
# File 'lib/tivohmo/api/container.rb', line 14

def uuid
  @uuid
end

Instance Method Details

#child_countObject



32
33
34
# File 'lib/tivohmo/api/container.rb', line 32

def child_count
  children.size
end

#initialize(identifier) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/tivohmo/api/container.rb', line 17

def initialize(identifier)
  super(identifier)
  self.uuid = SecureRandom.uuid
  self.presorted = false

  self.content_type = "x-tivo-container/tivo-videos"
  self.source_format = "x-tivo-container/folder"
end

#refreshObject



26
27
28
29
30
# File 'lib/tivohmo/api/container.rb', line 26

def refresh
  synchronize do
    self.children.clear
  end
end