# frozen_string_literal: true


module UserRepr
  BASE = { only: [:id, :name] }.freeze

  module_function

  def base user
    user.as_json(BASE)
  end

  def many users
    users.map { |u| base(u) }
  end
end
