class Ayril::XMLElement

Constants

URI

Attributes

id_counter[RW]

Public Class Methods

new(name, attributes={}) click to toggle source
# File lib/ayril/xml_element.rb, line 43
def self.new(name, attributes={})
  if attributes.empty? and name.include? "<"
    self.alloc.initWithXMLString name, error: nil
  else
    XMLNode.elementWithName name, children: nil, attributes: attributes
  end
end

Public Instance Methods

initWithName(name) click to toggle source
# File lib/ayril/xml_element.rb, line 53
def initWithName(name)
  self.class.alloc.tap { |e| e.name = name }
end
initWithXMLString(string, error: error) click to toggle source
# File lib/ayril/xml_element.rb, line 65
def initWithXMLString(string, error: error)
  d = XMLDocument.alloc.initWithXMLString(string, options: 0, error: nil)
  d.maybe(:rootElement).tap { |n| n.maybe :detach }
end
inspect() click to toggle source
# File lib/ayril/xml_element.rb, line 70
def inspect
  attributes = self.attribute.tap { |a| a.sync }
  "#<#{self.class}<#{self.name}#{attributes.maybe(:empty?) ? '' : ' '}#{attributes}>>"
end
kind() click to toggle source
# File lib/ayril/xml_element.rb, line 51
def kind; NSXMLElementKind end