4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/pox_paginate/active_resource/xml_format.rb', line 4
def self.included(mod)
mod.module_eval do
def (xml)
unless xml.blank?
deserialised_xml = (xml)
root_attributes = ::ActiveSupport::XmlMini.root_node_attributes(xml)
if root_attributes['type'] == "array" && root_attributes['current_page']
RemoteCollection.create(root_attributes['current_page'], root_attributes['per_page'], root_attributes['total_entries']) do ||
.replace deserialised_xml
end
else
deserialised_xml
end
else
RemoteCollection.create(1, 1, 0) do ||
end
end
end
alias_method_chain :decode, :pagination_support
end
end
|