Module: Roar::XML

Defined in:
lib/roar/xml.rb

Overview

Includes #from_xml and #to_xml into your represented object. In addition to that, some more options are available when declaring properties.

Defined Under Namespace

Modules: ClassMethods, HyperlinkRepresenter, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object


9
10
11
12
13
14
15
16
17
# File 'lib/roar/xml.rb', line 9

def self.included(base)
  base.class_eval do
    include Representer # Roar::Representer, this is needed for Rails URL helpers
    include Representable::XML

    extend ClassMethods
    include InstanceMethods # otherwise Representable overrides our #to_xml.
  end
end