Class: MediaProcessingTool::XMLParser::Document

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

Direct Known Subclasses

Identifier

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

self.load



17
18
19
# File 'lib/media_processing_tool/xml_parser/document.rb', line 17

def initialize(xml, params = { })
  @xml_document = self.class.xml_as_document(xml, params)
end

Class Method Details

.load(xml, params = { }) ⇒ Object

self.xml_as_document



13
14
15
# File 'lib/media_processing_tool/xml_parser/document.rb', line 13

def self.load(xml, params = { })
  new(xml, params)
end

.xml_as_document(xml, params = {}) ⇒ Object



9
10
11
# File 'lib/media_processing_tool/xml_parser/document.rb', line 9

def self.xml_as_document(xml, params = {})
  AXML.xml_as_document(xml)
end

Instance Method Details

#rootObject

xml_document



25
26
27
# File 'lib/media_processing_tool/xml_parser/document.rb', line 25

def root
  xml_document.root
end

#root_typeObject

Gets the



30
31
32
# File 'lib/media_processing_tool/xml_parser/document.rb', line 30

def root_type
  @root_type ||= root.name
end

#xml_documentObject

initialize



21
22
23
# File 'lib/media_processing_tool/xml_parser/document.rb', line 21

def xml_document
  @xml_document
end