Module: DataMapper::Serializer::XML
- Defined in:
- lib/dm-serializer/xml.rb,
lib/dm-serializer/xml/rexml.rb,
lib/dm-serializer/xml/libxml.rb,
lib/dm-serializer/xml/nokogiri.rb
Defined Under Namespace
Modules: LibXML, Nokogiri, REXML
Constant Summary collapse
- SERIALIZERS =
The supported XML Serializers
{ :libxml => 'LibXML', :nokogiri => 'Nokogiri', :rexml => 'REXML' }
Class Method Summary collapse
-
.serializer ⇒ Module
The current XML Serializer.
-
.serializer=(name) ⇒ Module
Sets the XML Serializer to use.
Class Method Details
.serializer ⇒ Module
The current XML Serializer.
19 20 21 |
# File 'lib/dm-serializer/xml.rb', line 19 def self.serializer @serializer end |
.serializer=(name) ⇒ Module
Sets the XML Serializer to use.
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/dm-serializer/xml.rb', line 35 def self.serializer=(name) serializer_const = SERIALIZERS[name] unless serializer_const raise(ArgumentError,"unsupported XML Serializer #{name}") end require "dm-serializer/xml/#{name}" @serializer = const_get(serializer_const) end |