lib/roar/representer/xml.rb in roar-0.8.2 vs lib/roar/representer/xml.rb in roar-0.8.3
- old
+ new
@@ -25,11 +25,11 @@
super
end
def to_xml(*args)
before_serialize(*args)
- super.serialize
+ super
end
# Generic entry-point for rendering.
def serialize(*args)
to_xml(*args)
@@ -39,11 +39,11 @@
module ClassMethods
include Representable::XML::ClassMethods
def links_definition_options
- {:from => :link, :as => [Hyperlink]}
+ {:from => :link, :as => Hyperlink, :collection => true}
end
# Generic entry-point for parsing.
def deserialize(*args)
from_xml(*args)
@@ -54,10 +54,10 @@
# Encapsulates a hypermedia <link ...>.
class Hyperlink
# TODO: make XML a module to include in Hyperlink < Base.
include XML
- self.representation_name = :link
+ self.representation_wrap = :link
property :rel, :from => "@rel"
property :href, :from => "@href"
end