class Yell::Adapters::Collection
Public Class Methods
new( options = {} )
click to toggle source
# File lib/yell/adapters.rb, line 11 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 16 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 41 def close @collection.each { |c| c.close } end
empty?()
click to toggle source
# File lib/yell/adapters.rb, line 30 def empty? @collection.empty? end
write( event )
click to toggle source
@private
# File lib/yell/adapters.rb, line 35 def write( event ) @collection.each { |c| c.write(event) } true end