class Pubsub
  require "google/cloud/pubsub"
  require "googleauth"

  def client
    creds = Google::Auth.get_application_default
    @pubsub ||= Google::Cloud::PubSub.new(
      project_id: Rails.application.credentials.gcs[:project]
    )
  end
end
