Class: Html2rss::ObjectToXmlConverter
- Inherits:
-
Object
- Object
- Html2rss::ObjectToXmlConverter
- Defined in:
- lib/html2rss/object_to_xml_converter.rb
Overview
A naive implementation of “Object to XML”: converts a Ruby object to XML format.
Constant Summary collapse
- OBJECT_TO_XML_TAGS =
{ hash: ['<object>', '</object>'], enumerable: ['<array>', '</array>'] }.freeze
Instance Method Summary collapse
-
#call ⇒ String
Converts the object to XML format.
-
#initialize(object) ⇒ ObjectToXmlConverter
constructor
A new instance of ObjectToXmlConverter.
Constructor Details
#initialize(object) ⇒ ObjectToXmlConverter
Returns a new instance of ObjectToXmlConverter.
17 18 19 |
# File 'lib/html2rss/object_to_xml_converter.rb', line 17 def initialize(object) @object = object end |
Instance Method Details
#call ⇒ String
Converts the object to XML format.
25 26 27 |
# File 'lib/html2rss/object_to_xml_converter.rb', line 25 def call object_to_xml(@object) end |