You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: response.rb
    path of file: ./repos/vets-api/lib/lighthouse/facilities
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require 'common/models/base'
require_relative 'facility'

module Lighthouse
  module Facilities
    class Response < Common::Base
      attribute :body, String
      attribute :current_page, Integer
      attribute :data, Object
      attrib
    
      def facilities
        facilities = data.each_with_index.map do |facility, index|
          fac = Lighthouse::Facilities::Facility.new(facility)
          fac.distance = meta['distances'][index]['distance'] unless meta['distances'].empty?
          fac
        end

        WillPaginate::Collection.create(current_page, per_page) do |pager|
          pager.replace(facilities)
          pager.total_entries = total_entries
        end
      end