class ViewModel::DeserializationError

def code

def code
  "DeserializationError.#{self.class.name.demodulize}"
end

def viewmodel_class

def viewmodel_class
  first = nodes.first.viewmodel_class
  unless nodes.all? { |n| n.viewmodel_class == first }
    raise ArgumentError.new("All nodes must be of the same type for #{self.class.name}")
  end
  first
end