Class: XMLable::Handlers::Document

Inherits:
Base
  • Object
show all
Defined in:
lib/xmlable/handlers/document.rb

Overview

Document class handles XML document

Instance Attribute Summary

Attributes inherited from Base

#block, #type

Instance Method Summary collapse

Methods inherited from Base

#block_settings?, build, #inject_wraped, #method_name, #options, #options?, #type_class, #wrapped_type?

Constructor Details

#initialize(type) ⇒ Document

Returns a new instance of Document.

Parameters:

  • type (Class)


10
11
12
# File 'lib/xmlable/handlers/document.rb', line 10

def initialize(type)
  @type = type
end

Instance Method Details

#from_xml_document(doc) ⇒ XMLable::Mixins::Object

Create document object from the XML document

Parameters:

  • doc (Nokogiri::XML::Document)

Returns:



28
29
30
# File 'lib/xmlable/handlers/document.rb', line 28

def from_xml_document(doc)
  Builder.build_document(doc, self)
end

#proxyObject

See Also:

  • XMLable::Handler::Base#proxy


17
18
19
# File 'lib/xmlable/handlers/document.rb', line 17

def proxy
  @type
end