Sha256: 2f850b89d0a58e07aa4a3486cafb8394ad77d8b31e00ba7233f676e5ccf7c64a
Contents?: true
Size: 792 Bytes
Versions: 117
Compression:
Stored size: 792 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_REPORTER.report exception FOREST_LOGGER.error "Cannot retrieve the Intercom attributes: #{exception.message}" end end end end
Version data entries
117 entries across 117 versions & 1 rubygems