class Rmodel::ArrayMapper
Public Class Methods
new(mapper)
click to toggle source
# File lib/rmodel/array_mapper.rb, line 3 def initialize(mapper) @mapper = mapper end
Public Instance Methods
deserialize(array)
click to toggle source
# File lib/rmodel/array_mapper.rb, line 15 def deserialize(array) if array.nil? nil else array.map { |entry| @mapper.deserialize(entry) } end end
serialize(objects, id_included)
click to toggle source
# File lib/rmodel/array_mapper.rb, line 7 def serialize(objects, id_included) if objects.nil? nil else objects.map { |object| @mapper.serialize(object, id_included) } end end