Commit d48ef04e authored by Matheus Agio Nerone's avatar Matheus Agio Nerone

moving models2hash from hash_builder to model_builder and improving it

Signed-off-by: Matheus Agio Nerone's avatarman13 <man13@inf.ufpr.br>
parent 10c2f2f2
......@@ -3,18 +3,7 @@ module Dspace
module HashBuilder
def obj2hash(list)
self.class.models2hash list
end
def self.models2hash(list)
if list.is_a? Array
hash = []
list.each do |m|
hash << m.to_h
end
hash
end
::Dspace::Builders::ModelBuilder.models2hash list
end
end
......
......@@ -56,6 +56,14 @@ module Dspace
colls
end
def self.models2hash(list)
if list.is_a? Array
list.map do |m|
m.to_h
end
end
end
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment