Sha256: 43e5cef5789a11bd961cc824153630cbc711140fd8fcc90357babe6fb4661281

Contents?: true

Size: 533 Bytes

Versions: 9

Compression:

Stored size: 533 Bytes

Contents

# frozen_string_literal: true

module Fusuma
  module Plugin
    module Buffers
      # Buffer events having KeypressRecord
      class AppmatcherBuffer < Buffer
        DEFAULT_SOURCE = 'appmatcher_parser'

        # @param event [Event]
        def buffer(event)
          return if event&.tag != source

          @events.push(event)
        end

        def clear_expired(*)
          @events = [@events.last] if @events.size > 100
        end

        def empty?
          @events.empty?
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
fusuma-plugin-appmatcher-0.1.6 lib/fusuma/plugin/buffers/appmatcher_buffer.rb
fusuma-plugin-appmatcher-0.1.5 lib/fusuma/plugin/buffers/appmatcher_buffer.rb
fusuma-plugin-appmatcher-0.1.4 lib/fusuma/plugin/buffers/appmatcher_buffer.rb
fusuma-plugin-appmatcher-0.1.3 lib/fusuma/plugin/buffers/appmatcher_buffer.rb
fusuma-plugin-appmatcher-0.1.2 lib/fusuma/plugin/buffers/appmatcher_buffer.rb
fusuma-plugin-appmatcher-0.1.1 lib/fusuma/plugin/buffers/appmatcher_buffer.rb
fusuma-plugin-appmatcher-0.1.0 lib/fusuma/plugin/buffers/appmatcher_buffer.rb
fusuma-plugin-appmatcher-0.1.0.pre2 lib/fusuma/plugin/buffers/appmatcher_buffer.rb
fusuma-plugin-appmatcher-0.1.0.pre lib/fusuma/plugin/buffers/appmatcher_buffer.rb