Module: XMLable::Mixins::DocumentStorage
- Defined in:
- lib/xmlable/mixins/document_storage.rb
Overview
DocumentStorage module contains the logic to work with XML document
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#__document_handler ⇒ XMLable::Handlers::Document
private
Get document’s handler.
-
#encoding ⇒ String?
Get XML document encoding.
- #initialize(args = {}, doc = nil, handler = nil) ⇒ Object
-
#version ⇒ String?
Get XML document version.
Class Method Details
.included(base) ⇒ Object
7 8 9 |
# File 'lib/xmlable/mixins/document_storage.rb', line 7 def self.included(base) base.send(:extend, ClassMethods) end |
Instance Method Details
#__document_handler ⇒ XMLable::Handlers::Document
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Get document’s handler
47 48 49 |
# File 'lib/xmlable/mixins/document_storage.rb', line 47 def __document_handler self.class.__document_handler end |
#encoding ⇒ String?
Get XML document encoding
36 37 38 |
# File 'lib/xmlable/mixins/document_storage.rb', line 36 def encoding __node.encoding end |
#initialize(args = {}, doc = nil, handler = nil) ⇒ Object
16 17 18 19 20 |
# 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 |
#version ⇒ String?
Get XML document version
27 28 29 |
# File 'lib/xmlable/mixins/document_storage.rb', line 27 def version __node.version end |