Module: CocoaXML::NSXMLDocumentExtras

Defined in:
lib/cocoa-xml/nsxmldocument_extras.rb

Class Method Summary collapse

Instance Method Summary collapse

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

#encodingNSString

Encoding of document

Returns:

  • (NSString)

    encoding of document

See Also:



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

Parameters:

  • enc (NSString)

    valid character encoding

See Also:



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

Returns:

  • (Boolean)


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

Returns:

  • (Boolean)


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

Returns:

  • (Boolean)


42
43
44
# File 'lib/cocoa-xml/nsxmldocument_extras.rb', line 42

def xml?
  documentContentKind == NSXMLDocumentXMLKind
end