class Ayril::XMLDocument

Public Class Methods

new(data, error=nil) click to toggle source
# File lib/ayril/xml_document.rb, line 26
def self.new(data, error=nil)
  path = data.dup
  path = NSURL.fileURLWithPath data.path if data.kind_of? File
  if path.kind_of? NSURL
    XMLDocument.alloc.initWithContentsOfURL path, options: 0, error: error
  elsif path.kind_of? XMLElement
    XMLDocument.alloc.initWithRootElement path
  elsif path.kind_of? String
    XMLDocument.alloc.initWithXMLString path, options: 0, error: error
  end
end
replacementClassForClass(currentClass) click to toggle source
# File lib/ayril/xml_document.rb, line 38
def self.replacementClassForClass(currentClass)
  return {
    NSXMLNode     => XMLNode,
    NSXMLElement  => XMLElement,
    NSXMLDocument => XMLDocument,
    NSXMLDTD      => XMLDTD,
    NSXMLDTDNode  => XMLDTDNode
  }[currentClass]
end

Public Instance Methods

inspect() click to toggle source
# File lib/ayril/xml_document.rb, line 51
def inspect
  "#<#{self.class}:0x#{self.object_id.to_s(16)}>"
end