module XMLable::Mixins::DocumentStorage

DocumentStorage module contains the logic to work with XML document

Public Class Methods

included(base) click to toggle source
# File lib/xmlable/mixins/document_storage.rb, line 7
def self.included(base)
  base.send(:extend, ClassMethods)
end
new(args = {}, doc = nil, handler = nil) click to toggle source

@param [Hash] args document initial params @param [Nokogiri::XML::Document] doc XML document @param [XMLable::Handlers::Document] handler document's handler

Calls superclass method
# File lib/xmlable/mixins/document_storage.rb, line 16
def initialize(args = {}, doc = nil, handler = nil)
  doc ||= Nokogiri::XML::Document.new
  handler ||= Handlers::Document.new(self.class)
  super
end

Public Instance Methods

__document_handler() click to toggle source

Get document's handler

@api private

@return [XMLable::Handlers::Document]

# File lib/xmlable/mixins/document_storage.rb, line 47
def __document_handler
  self.class.__document_handler
end
encoding() click to toggle source

Get XML document encoding

@return [String, nil]

# File lib/xmlable/mixins/document_storage.rb, line 36
def encoding
  __node.encoding
end
version() click to toggle source

Get XML document version

@return [String, nil]

# File lib/xmlable/mixins/document_storage.rb, line 27
def version
  __node.version
end