Sha256: fad372ccf46cc4c4256f1b1c68a04c2fe1142a16fa12ccaa120529d2cd14856a

Contents?: true

Size: 1015 Bytes

Versions: 23

Compression:

Stored size: 1015 Bytes

Contents

module Listen
  module Event
    class Config
      def initialize(
        listener,
        event_queue,
        queue_optimizer,
        wait_for_delay,
        &block)

        @listener = listener
        @event_queue = event_queue
        @queue_optimizer = queue_optimizer
        @min_delay_between_events = wait_for_delay
        @block = block
      end

      def sleep(*args)
        Kernel.sleep(*args)
      end

      def call(*args)
        @block.call(*args) if @block
      end

      def timestamp
        Time.now.to_f
      end

      def event_queue
        @event_queue
      end

      def callable?
        @block
      end

      def optimize_changes(changes)
        @queue_optimizer.smoosh_changes(changes)
      end

      def min_delay_between_events
        @min_delay_between_events
      end

      def stopped?
        listener.state == :stopped
      end

      def paused?
        listener.state == :paused
      end

      private

      attr_reader :listener
    end
  end
end

Version data entries

23 entries across 23 versions & 8 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/listen-3.0.8/lib/listen/event/config.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/listen-3.0.8/lib/listen/event/config.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/listen-3.0.8/lib/listen/event/config.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/listen-3.0.8/lib/listen/event/config.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/listen-3.0.8/lib/listen/event/config.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/listen-3.0.8/lib/listen/event/config.rb
listen-3.0.8 lib/listen/event/config.rb
sass-listen-3.0.7 lib/listen/event/config.rb
listen-3.0.7 lib/listen/event/config.rb
listen-3.0.6 lib/listen/event/config.rb
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/listen-3.0.5/lib/listen/event/config.rb
listen-3.0.5 lib/listen/event/config.rb
listen-3.0.4 lib/listen/event/config.rb
mastermind_adeybee-0.1.4 vendor/bundle/ruby/2.2.0/gems/listen-3.0.3/lib/listen/event/config.rb
mastermind_adeybee-0.1.3 vendor/bundle/ruby/2.2.0/gems/listen-3.0.3/lib/listen/event/config.rb
mastermind_adeybee-0.1.2 vendor/bundle/ruby/2.2.0/gems/listen-3.0.3/lib/listen/event/config.rb
mastermind_adeybee-0.1.1 vendor/bundle/ruby/2.2.0/gems/listen-3.0.3/lib/listen/event/config.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/listen-3.0.3/lib/listen/event/config.rb
geminfo-0.1.0 path/gems/listen-3.0.3/lib/listen/event/config.rb
listen-3.0.3 lib/listen/event/config.rb