Parent

Yell::Adapters::Collection

Public Class Methods

new( options = {} ) click to toggle source
# File lib/yell/adapters.rb, line 13
def initialize( options = {} )
  @options = options
  @collection = []
end

Public Instance Methods

add( type = :file, *args, &block ) click to toggle source
# File lib/yell/adapters.rb, line 18
def add( type = :file, *args, &block )
  options = [@options, *args].inject(Hash.new) do |h, c|
    h.merge( [String, Pathname].include?(c.class) ? {:filename => c} : c  )
  end

  # remove possible :null adapters
  @collection.shift if @collection.first.instance_of?(Yell::Adapters::Base)

  new_adapter = Yell::Adapters.new(type, options, &block)
  @collection.push(new_adapter)

  new_adapter
end
close() click to toggle source

@private

# File lib/yell/adapters.rb, line 43
def close
  @collection.each { |c| c.close }
end
empty?() click to toggle source
# File lib/yell/adapters.rb, line 32
def empty?
  @collection.empty?
end
write( event ) click to toggle source

@private

# File lib/yell/adapters.rb, line 37
def write( event )
  @collection.each { |c| c.write(event) }
  true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.