Sha256: 631237124a138c4724d5286b4454bbfe0c8c00377098cae5019484412ae66f1d

Contents?: true

Size: 483 Bytes

Versions: 3

Compression:

Stored size: 483 Bytes

Contents

module Hallmonitor
  class Outputter
    attr_reader :name
    @@outputters = Array.new

    def initialize(name)
      raise(ArgumentError, "Outputter expects a name") if name.nil?
      @name = name
    end

    def self.add_outputter(outputter)
      @@outputters << outputter if outputter.respond_to?(:process)
    end

    def self.output(event)
      @@outputters.each do |o|
        o.process(event)
      end
    end

    def process(event)
      # Nothing
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hallmonitor-0.1.0 lib/hallmonitor/outputter.rb
hallmonitor-0.0.2 lib/hallmonitor/outputter.rb
hallmonitor-0.0.1 lib/hallmonitor/outputter.rb