Module: TivoHMO::API::Item

Overview

Represents the tivo concept of an Item (i.e. a file that can be displayed), and is always a leaf node in the tree.

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, #tree_string

Instance Attribute Details

#fileObject

Returns the value of attribute file.



11
12
13
# File 'lib/tivohmo/api/item.rb', line 11

def file
  @file
end

#subtitleObject

Returns the value of attribute subtitle.



11
12
13
# File 'lib/tivohmo/api/item.rb', line 11

def subtitle
  @subtitle
end

Instance Method Details

#initialize(identifier) ⇒ Object



13
14
15
16
17
# File 'lib/tivohmo/api/item.rb', line 13

def initialize(identifier)
  super(identifier)
  self.content_type = "video/x-tivo-mpeg"
  self.source_format = "video/x-tivo-mpeg"
end

#metadataObject



19
20
21
# File 'lib/tivohmo/api/item.rb', line 19

def 
  @metadata ||= app.(self)
end

#to_sObject



27
28
29
# File 'lib/tivohmo/api/item.rb', line 27

def to_s
  "<#{self.class.name}: #{self.identifier}>"
end

#transcoderObject



23
24
25
# File 'lib/tivohmo/api/item.rb', line 23

def transcoder
  @transcoder ||= app.transcoder_for(self)
end