Sha256: 94f3a02e82f3b63f1f3776a473aebdd63cd266fcf15f49726061b9c278fe4380
Contents?: true
Size: 751 Bytes
Versions: 198
Compression:
Stored size: 751 Bytes
Contents
module ForestLiana class IntercomAttributesGetter < IntegrationBaseGetter attr_accessor :record def initialize(params) @params = params @intercom = ::Intercom::Client.new(token: ForestLiana.integrations[:intercom][:access_token]) end def perform begin resource = collection.find(@params[:id]) user = @intercom.users.find(email: resource.email) user.segments = user.segments.map do |segment| @intercom.segments.find(id: segment.id) end @record = user rescue Intercom::ResourceNotFound rescue Intercom::UnexpectedError => exception FOREST_LOGGER.error "Cannot retrieve the Intercom attributes: #{exception.message}" end end end end
Version data entries
198 entries across 198 versions & 1 rubygems