Module: Wakizashi::Element::CreationMethods

Included in:
GDataXMLElement
Defined in:
lib/wakizashi/xml_element.rb

Instance Method Summary collapse

Instance Method Details

#with_html(html) ⇒ Object



4
5
6
7
8
9
# File 'lib/wakizashi/xml_element.rb', line 4

def with_html(html)
  error_ptr = Pointer.new(:id)
  elem = self.alloc.initWithHTMLString(html, error:error_ptr)
  raise Wakizashi::ParseError, error_ptr[0].description if error_ptr[0]
  elem
end

#with_xml(xml) ⇒ Object



11
12
13
14
15
16
# File 'lib/wakizashi/xml_element.rb', line 11

def with_xml(xml)
  error_ptr = Pointer.new(:id)
  elem = self.alloc.initWithXMLString(xml, error:error_ptr)
  raise Wakizashi::ParseError, error_ptr[0].description if error_ptr[0]
  elem
end