Module: CocoaXML::NSXMLDocumentExtras
- Defined in:
- lib/cocoa-xml/nsxmldocument_extras.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#encoding ⇒ NSString
Encoding of document.
-
#encoding=(enc) ⇒ void
Set encoding of document.
-
#html? ⇒ Boolean
Determine if output of document is treated as HTML, e.g.
-
#xhtml? ⇒ Boolean
Determine if output of document is treated as XHTML, e.g.
-
#xml? ⇒ Boolean
Determine if output of document is treated as XML.
Class Method Details
.included(klass) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/cocoa-xml/nsxmldocument_extras.rb', line 4 def self.included(klass) klass.class_eval do alias :encoding :characterEncoding alias :encoding= :setCharacterEncoding end end |
Instance Method Details
#encoding ⇒ NSString
Encoding of document
16 17 18 |
# File 'lib/cocoa-xml/nsxmldocument_extras.rb', line 16 def encoding # Implemented as alias to characterEncoding end |
#encoding=(enc) ⇒ void
This method returns an undefined value.
Set encoding of document
27 28 29 |
# File 'lib/cocoa-xml/nsxmldocument_extras.rb', line 27 def encoding=(enc) # Implemented as an alias to setCharacterEncoding end |
#html? ⇒ Boolean
Determine if output of document is treated as HTML, e.g.
style tags
32 33 34 |
# File 'lib/cocoa-xml/nsxmldocument_extras.rb', line 32 def html? documentContentKind == NSXMLDocumentHTMLKind end |
#xhtml? ⇒ Boolean
Determine if output of document is treated as XHTML, e.g. <br/> style tags
37 38 39 |
# File 'lib/cocoa-xml/nsxmldocument_extras.rb', line 37 def xhtml? documentContentKind == NSXMLDocumentXHTMLKind end |
#xml? ⇒ Boolean
Determine if output of document is treated as XML
42 43 44 |
# File 'lib/cocoa-xml/nsxmldocument_extras.rb', line 42 def xml? documentContentKind == NSXMLDocumentXMLKind end |