Class: MediaProcessingTool::XMLParser::Identifier

Inherits:
Document
  • Object
show all
Defined in:
lib/media_processing_tool/xml_parser/identifier.rb

Instance Method Summary collapse

Methods inherited from Document

load, #root, #root_type, xml_as_document, #xml_document

Constructor Details

#initialize(xml, params = { }) ⇒ Identifier



8
9
10
# File 'lib/media_processing_tool/xml_parser/identifier.rb', line 8

def initialize(xml, params = { })
  super(xml, params)
end

Instance Method Details

#is_fcpxml?Boolean

initialize



12
13
14
# File 'lib/media_processing_tool/xml_parser/identifier.rb', line 12

def is_fcpxml?
  root_type == 'fcpxml'
end

#is_final_cut_pro?Boolean

is_plist?



24
25
26
# File 'lib/media_processing_tool/xml_parser/identifier.rb', line 24

def is_final_cut_pro?
  is_xmeml? || is_fcpxml?
end

#is_itunes?Boolean

is_final_cut_pro?



28
29
30
# File 'lib/media_processing_tool/xml_parser/identifier.rb', line 28

def is_itunes?
  is_plist? and !xml_document.find('/plist/dict/key[text()="Tracks"]').empty?
end

#is_plist?Boolean

is_xmeml?



20
21
22
# File 'lib/media_processing_tool/xml_parser/identifier.rb', line 20

def is_plist?
  root_type == 'plist'
end

#is_xmeml?Boolean

is_fcpxml?



16
17
18
# File 'lib/media_processing_tool/xml_parser/identifier.rb', line 16

def is_xmeml?
  root_type == 'xmeml'
end

#typeObject

is_itunes?



32
33
34
35
36
37
# File 'lib/media_processing_tool/xml_parser/identifier.rb', line 32

def type
  return :final_cut_pro if is_final_cut_pro?
  return :itunes if is_itunes?
  return :plist if is_plist?
  return :unknown
end