Sha256: da32d7555a46e2524800b0917811a20f765125ece5d3ad2ed631376f207fa7f6

Contents?: true

Size: 724 Bytes

Versions: 3

Compression:

Stored size: 724 Bytes

Contents

class FluQ::Feed::Base
  include Enumerable
  include FluQ::Mixins::Loggable
  extend FluQ::Mixins::Loggable

  # @abstract enumerator
  # @param [String] raw event string
  # @return [FluQ::Event] event
  def self.to_event(raw)
  end

  # @attr_reader [FluQ::Buffer::Base] buffer
  attr_reader :buffer

  # @param [FluQ::Buffer::Base] buffer
  def initialize(buffer)
    @buffer = buffer
  end

  # @yield ober a feed of events
  # @yieldparam [FluQ::Event] event
  def each
    each_raw do |raw|
      event = self.class.to_event(raw)
      yield event if event
    end
  end

  protected

    # @abstract enumerator
    # @yield ober a feed of raw events
    # @yieldparam [String] raw event
    def each_raw
    end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fluq-0.7.5 lib/fluq/feed/base.rb
fluq-0.7.3 lib/fluq/feed/base.rb
fluq-0.7.1 lib/fluq/feed/base.rb